Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
Timer¶
A countdown timer.
Description¶
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.
Tutorials¶
Properties¶
|
||
|
||
|
||
|
Methods¶
is_stopped ( ) const |
|
void |
|
void |
stop ( ) |
Signals¶
timeout ( )
Emitted when the timer reaches 0.
Enumerations¶
enum TimerProcessCallback:
TimerProcessCallback TIMER_PROCESS_PHYSICS = 0
Update the timer during physics frames (see Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS).
TimerProcessCallback TIMER_PROCESS_IDLE = 1
Update the timer during process frames (see Node.NOTIFICATION_INTERNAL_PROCESS).
Property Descriptions¶
bool autostart = false
If 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 = false
If true
, the timer will stop when reaching 0. If false
, it will restart.
bool paused
If true
, the timer is paused and will not process until it is unpaused again, even if start is called.
TimerProcessCallback process_callback = 1
void set_timer_process_callback ( TimerProcessCallback value )
TimerProcessCallback get_timer_process_callback ( )
Processing callback. See TimerProcessCallback.