Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Syl |
Greets!
Here: got an animation startin at 7 mouse clicks on screen, and i want their count to stop once 7 is reached.
Here’s my lil code for that:
func _input(event):
if event is InputEventMouseButton:
if event.button_index == BUTTON_LEFT and event.pressed:
clicks += 1
if clicks == 7 and event.button_index == BUTTON_LEFT and event.pressed:
event.pressed == null
get_node("AnimationPlayer").play("change")
But event.pressed doesn’t work, and clicks are still added… What should it be please?