Canvas layer stop click

Godot Version

4.2 stable

Question

As you can see on pic, there are 2 control nodes, 2 of them have MouseFilter -Pass, Them all FullScreen, and i cant listen gui_input signal from Control_2. Because of Canvas Layer or what?

image

2 Likes

I have reproduced your scene with a print statement like this in the script:

func _on_control_2_gui_input(event):
print(“Listen here little…”)

When Control2 is in the scene root node, it can’t be clicked because of the priority given to the CanvasLayer.
The CanvasLayer is on “Layer”: 1 by default in the inspector.
I did set it to “0” but it’s not enough.
To be able to click throught and get your listening even to work (verified with my print), you need to set your CanvasLayer “Layer” to: -1

I hope that helps clear that confusion.

2 Likes

Hello, thank you for the response. Contributors on GitHub provided an answer. The issue is that the control node only passes the click to the parent of the control node. I wasn’t aware of this, but there’s ongoing development to address it, and the resolution is indeed under discussion. Since it’s a small but still a limiting factor in the functionality of the control node, they provided an article on GitHub. If someone else encounters the same issue, it might be helpful to read (it helped me) :
Rename the Mouse Filter modes and add a Skip mouse filter mode · Issue #3613 · godotengine/godot-proposals (github.com)

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.