Created
January 17, 2016 19:25
-
-
Save FEDE0D/e6e501051175ae5a95c4 to your computer and use it in GitHub Desktop.
Timer in Godot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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