+2 votes

Hey folks,

What happens right now...
I have a conundrum about how to approach movable units on a TileMap. I'm using Area2D for the units, and this offers the input_event signal to check when a unit has been clicked. This works fine. In order to move units, I need to select a tile on the TileMap, which I can do with _input(event).

However, clicking on a unit (Area2D), also triggers an event on the TileMap. What's more, the TileMap event is fired first due to the order in which events and signals work. Whenever I click on a unit, the tile beneath it receives an event too, and ahead of the unit.

What I want to achieve...

Ideally, I want the unit to receive its event/signal first and the event to propagate no further. Is Area2D the wrong node to be using for a unit that I want to be selectable? Can you recommend another approach?

Any help would be appreciated. Thanks! :)

in Engine by (366 points)

Did you manage to solve your problem?

I have the same problem and haven't found an elegant answer yet.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.