Skip to content

Instantly share code, notes, and snippets.

@FEDE0D
Created January 17, 2016 19:25
Show Gist options
  • Save FEDE0D/e6e501051175ae5a95c4 to your computer and use it in GitHub Desktop.
Save FEDE0D/e6e501051175ae5a95c4 to your computer and use it in GitHub Desktop.
Timer in Godot
const TIMER = 2.0 # 2 seconds
var timer = 0.0
# use _process or _fixed_process for physics stuff
func _process(delta):
timer += delta
if timer > TIMER:
do_something()
timer = 0.0
func do_something():
print("It's time!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment