Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Robster |
Hi all, I have a tilemap where my character moves about and I have various HUD buttons etc.
Currently I click on a hud button but as the HUD sits above the tilemap, the character moves to where the button is.
How can I stop this happening so that the character only moves if I clicked on the Tilemap and nothing else?
Thanks so much
(here is my move code)
func _input(event):
if event.is_action_pressed('click'):
if globals.activity == "walk":
target_position = get_global_mouse_position()
_change_state(STATES.FOLLOW)