|Topic was automatically imported from the old Question2Answer platform.
I have a character node with Area2D receiving
Below that I have a tilemap receiving
How do I make the character node run first. I’ve tried moving the nodes around, and it seems like
_unhandled_input always runs before it.
[InputEventMouseButton:1312] Map False
[InputEventMouseButton:1312] Guy True
The bool at end is just
is_input_handled() at end of function.
I’m doing this in GDScript.
Looking at the InputEvent Docs, that seems to be expected behavior. The order in which input is handed out to various nodes is as follows:
_unhandled_input ← your tilemap
CollisionObject._input_event ← your Area2D
If you want the Area2D to get events before the tilemap, the simple fix is to change the Area2D to use
_input instead of
_input_event, although depending on what else in your app listens for inputs it might get more complicated than that.
As a reminder, make sure you’re using
set_input_as_handled or whatever as appropriate if you don’t want the event to get handed out further down the list.