#for Godot v3 How do I give a cooldown for pressing a button. (its mostly for a flying mechanic and w

2 messages · Page 1 of 1 (latest)

merry sluice
#

for Godot v3 How do I give a cooldown for pressing a button. (its mostly for a flying mechanic and without the cooldown they can infinitely fly).

quick sierra
#

You could use a countdown timer that is initally set to 0. In the code where you are checking if the fly button is pressed add a check if the timer's time_left == 0. When you start them flying set the timer to how long you want the cooldown to be with start(cooldown).
https://docs.godotengine.org/en/3.5/classes/class_timer.html