A countdown timer.
Counts down a specified interval and emits a signal on reaching 0. Can be set to repeat or "one-shot" mode.
Note: Timers are affected by Engine.time_scale, a higher scale means quicker timeouts, and vice versa.
Note: To create a one-shot timer without instantiating a node, use SceneTree.create_timer.
is_stopped ( ) const
stop ( )
timeout ( )
Emitted when the timer reaches 0.
TimerProcessMode TIMER_PROCESS_PHYSICS =
Update the timer during the physics step at each frame (fixed framerate processing).
TimerProcessMode TIMER_PROCESS_IDLE =
Update the timer during the idle time at each frame.
bool autostart =
true, the timer will automatically start when entering the scene tree.
Note: This property is automatically set to
false after the timer enters the scene tree and starts.
bool one_shot =
true, the timer will stop when reaching 0. If
false, it will restart.
true, the timer is paused and will not process until it is unpaused again, even if start is called.
TimerProcessMode process_mode =
Processing mode. See TimerProcessMode.
float get_time_left ( )
The timer's remaining time in seconds. Returns 0 if the timer is inactive.
Note: You cannot set this value. To change the timer's remaining time, use start.
float wait_time =
The wait time in seconds.
Note: Timers can only emit once per rendered frame at most (or once per physics frame if process_mode is TIMER_PROCESS_PHYSICS). This means very low wait times (lower than 0.05 seconds) will behave in significantly different ways depending on the rendered framerate. For very low wait times, it is recommended to use a process loop in a script instead of using a Timer node. Timers are affected by Engine.time_scale, a higher scale means quicker timeouts, and vice versa.
bool is_stopped ( ) const
true if the timer is stopped.
void start ( float time_sec=-1 )
Starts the timer. Sets
time_sec > 0. This also resets the remaining time to
Note: This method will not resume a paused timer. See paused.
void stop ( )
Stops the timer.