How to I create a one-shot timer?
[!question] How do I create a timer that doesn't repeat so I can wait a certain amount of time exactly once without creating a
Timer
node?
Use SceneTree
's
create_timer
method and use the
timeout
property of the newly-created
SceneTreeTimer
.
func some_function():
print("Timer started.")
get_tree().create_timer(1.0).timeout
await print("Timer ended.")