I would like for when the player double taps a button then it does a certain action i dont know how to represent that example:(Input.is_action_pressed ("ui_left")). If this is not the right way to go about it i would like to see a better way to do it if possible. Thank you in advance.
I need help with double taps of a key.
- Edited
You'll want to use input events, since those just fire once when you press the key. Then you just set a timer for whatever double-tap speed you want, and if it's still playing when you press the same key again, that's your double-tap.
func _input(event):
if event.is_action_pressed("left"):
if get_node("Timer").is_processing():
double_tap_left()
else: get_node("Timer").start()
6 years later
Megalomaniak added the Godot Help tag .