Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Squabix |
If you are new to timers, here’s a simple timer that you can create:
count = 0
func _process(delta):
if count == 60:
print("Waited one second")
count = 0
else:
count += 1
The code above creates a one second timer because the _process
function is called every frame (60 times a second). If count
is not 60 yet, 1 gets added to count
. If count
is 60 (one second has passed), it executes what happens every second, and count
goes back to 0. I hope this helps!