-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined propagation order for clicks on overlapped CollisionShape2D #23051
Comments
Still valid in 6831da6 |
Yup, I'm experiencing this problem too, and it makes it almost impossible to work with clicking on collision shapes in Godot since the event propagation order is erratic and seemingly random. My use-case: I'm building a little RTS and want to be able to 1) select units by clicking on them and 2) make them move to a target point if you click the ground. Since I'm getting desperate at this point, especially since behavior like this is presumably really common and should be very straightforward to achieve (at least in theory) |
I've found a workaround using a simple "state machine", prioritizing unit's Area2D over map Area2D |
This is still an issue in stable Godot 3.3 See the attached testgame: It has two Area2Ds with overlapping shapes: It would've been expected (based on the documentation), that abb's input_event would be called first and then aba. Instead it is the other way around. Running the test game and clicking on the top left corner of the screen yields:
This is the result on my machine. Reading the OP's description it may be the other way around as well as they've written, that there's no defined order. |
Godot version:
v3.1.alpha.official
OS/device including version:
Issue description:
Propagation order of mouse click event can be different on sequenced launches without any changes in project using CollisionShape2D for input handling.
Steps to reproduce:
(You can use attached project instead of doing 1 - 9 below)
Minimal reproduction project:
TestOverlapCollisionShape2D.zip
The text was updated successfully, but these errors were encountered: