diff --git a/doc/classes/Timer.xml b/doc/classes/Timer.xml index fc8d89b4c8e..b425b29bfe7 100644 --- a/doc/classes/Timer.xml +++ b/doc/classes/Timer.xml @@ -5,14 +5,14 @@ The [Timer] node is a countdown timer and is the simplest way to handle time-based logic in the engine. When a timer reaches the end of its [member wait_time], it will emit the [signal timeout] signal. - After a timer enters the tree, it can be manually started with [method start]. A timer node is also started automatically if [member autostart] is [code]true[/code]. + After a timer enters the scene tree, it can be manually started with [method start]. A timer node is also started automatically if [member autostart] is [code]true[/code]. Without requiring much code, a timer node can be added and configured in the editor. The [signal timeout] signal it emits can also be connected through the Node dock in the editor: [codeblock] func _on_timer_timeout(): print("Time to attack!") [/codeblock] [b]Note:[/b] To create a one-shot timer without instantiating a node, use [method SceneTree.create_timer]. - [b]Note:[/b] Timers are affected by [member Engine.time_scale]. The higher the time scale, the sooner timers will end. How often a timer processes may depend on the framerate or [member Engine.physics_ticks_per_second]. + [b]Note:[/b] Timers are affected by [member Engine.time_scale] unless [member ignore_time_scale] is [code]true[/code]. The higher the time scale, the sooner timers will end. How often a timer processes may depend on the framerate or [member Engine.physics_ticks_per_second]. https://godotengine.org/asset-library/asset/2712 @@ -28,14 +28,15 @@ - Starts the timer, or resets the timer if it was started already. Fails if the timer is not inside the tree. If [param time_sec] is greater than [code]0[/code], this value is used for the [member wait_time]. + Starts the timer, or resets the timer if it was started already. Fails if the timer is not inside the scene tree. If [param time_sec] is greater than [code]0[/code], this value is used for the [member wait_time]. [b]Note:[/b] This method does not resume a paused timer. See [member paused]. - Stops the timer. + Stops the timer. See also [member paused]. Unlike [method start], this can safely be called if the timer is not inside the scene tree. + [b]Note:[/b] Calling [method stop] does not emit the [signal timeout] signal, as the timer is not considered to have timed out. If this is desired, use [code]$Timer.timeout.emit()[/code] after calling [method stop] to manually emit the signal. @@ -52,7 +53,7 @@ If [code]true[/code], the timer will stop after reaching the end. Otherwise, as by default, the timer will automatically restart. - If [code]true[/code], the timer is paused. A paused timer does not process until this property is set back to [code]false[/code], even when [method start] is called. + If [code]true[/code], the timer is paused. A paused timer does not process until this property is set back to [code]false[/code], even when [method start] is called. See also [method stop]. Specifies when the timer is updated during the main loop.