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 | |
void | |
void | stop ( ) |
Emitted when the timer reaches 0.
0
Update the timer during physics frames (see Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS).
1
Update the timer during process frames (see Node.NOTIFICATION_INTERNAL_PROCESS).
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.
false
If true, the timer will stop when reaching 0. If false, it will restart.
If true, the timer is paused and will not process until it is unpaused again, even if start is called.
1
Processing callback. See TimerProcessCallback.
The timer's remaining time in seconds. Returns 0 if the timer is inactive.
Note: This value is read-only and cannot be set. It is based on wait_time, which can be set using start.
1.0
The wait time in seconds.
Note: Timers can only emit once per rendered frame at most (or once per physics frame if process_callback 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.
Returns true if the timer is stopped.
Starts the timer. Sets wait_time to time_sec if time_sec > 0. This also resets the remaining time to wait_time.
Note: This method will not resume a paused timer. See paused.
Stops the timer.
© 2014–present Juan Linietsky, Ariel Manzur and the Godot community
Licensed under the Creative Commons Attribution Unported License v3.0.
https://docs.godotengine.org/en/4.2/classes/class_timer.html