You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on a project, I was having issues using the mouse_entered signal.
One of my nodes was consuming the mouse event, after some digging I found the culprit; MarginContainer.
I decided to create a new test scene to re-create the bug and to my surprise, the bug still occured.
MarginContainer nodes will always consume mouse input events when set to mouse filter PASS if a margin container exists in the scene tree lower than the node that you are attempting to receive them in.
I waved my mouse over the area of the nodes and the console didn't log anything from my script.
Once I changed the MarginContainer's mouse filter to ignore, it finally got it to print the event in my other node.
Temporarily, you can opt to have that container always ignore mouse events so that they can be caught elsewhere.
But for now, you'll just have to deal with margin containers always consuming these events if set to Pass.
If this control does not handle the event, the parent control (if any) will be considered, and so on until there is no more parent control to potentially handle it.
The event is passed to parent nodes not siblings. You need to use IGNORE.
Godot version
4.0.stable
System information
Windows 10
Issue description
While working on a project, I was having issues using the mouse_entered signal.
One of my nodes was consuming the mouse event, after some digging I found the culprit; MarginContainer.
I decided to create a new test scene to re-create the bug and to my surprise, the bug still occured.
MarginContainer nodes will always consume mouse input events when set to mouse filter PASS if a margin container exists in the scene tree lower than the node that you are attempting to receive them in.
I waved my mouse over the area of the nodes and the console didn't log anything from my script.
Once I changed the MarginContainer's mouse filter to ignore, it finally got it to print the event in my other node.
Temporarily, you can opt to have that container always ignore mouse events so that they can be caught elsewhere.
But for now, you'll just have to deal with margin containers always consuming these events if set to Pass.
Steps to reproduce
Minimal reproduction project
Reproduction Project.zip
The text was updated successfully, but these errors were encountered: