|
84 | 84 | <return type="void" /> |
85 | 85 | <param index="0" name="delta" type="float" /> |
86 | 86 | <description> |
87 | | - Called during the physics processing step of the main loop. Physics processing means that the frame rate is synced to the physics, i.e. the [param delta] parameter will [i]generally[/i] be constant (see exceptions below). [param delta] is in seconds. |
88 | | - It is only called if physics processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_physics_process]. |
| 87 | + Called once on each physics tick, and allows Nodes to synchronize their logic with physics ticks. [param delta] is the logical time between physics ticks in seconds and is equal to [member Engine.time_scale] / [member Engine.physics_ticks_per_second]. |
| 88 | + It is only called if physics processing is enabled for this Node, which is done automatically if this method is overridden, and can be toggled with [method set_physics_process]. |
89 | 89 | Processing happens in order of [member process_physics_priority], lower priority values are called first. Nodes with the same priority are processed in tree order, or top to bottom as seen in the editor (also known as pre-order traversal). |
90 | 90 | Corresponds to the [constant NOTIFICATION_PHYSICS_PROCESS] notification in [method Object._notification]. |
91 | 91 | [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). |
92 | | - [b]Note:[/b] [param delta] will be larger than expected if running at a framerate lower than [member Engine.physics_ticks_per_second] / [member Engine.max_physics_steps_per_frame] FPS. This is done to avoid "spiral of death" scenarios where performance would plummet due to an ever-increasing number of physics steps per frame. This behavior affects both [method _process] and [method _physics_process]. As a result, avoid using [param delta] for time measurements in real-world seconds. Use the [Time] singleton's methods for this purpose instead, such as [method Time.get_ticks_usec]. |
| 92 | + [b]Note:[/b] Accumulated [param delta] may diverge from real world seconds. |
93 | 93 | </description> |
94 | 94 | </method> |
95 | 95 | <method name="_process" qualifiers="virtual"> |
96 | 96 | <return type="void" /> |
97 | 97 | <param index="0" name="delta" type="float" /> |
98 | 98 | <description> |
99 | | - Called during the processing step of the main loop. Processing happens at every frame and as fast as possible, so the [param delta] time since the previous frame is not constant. [param delta] is in seconds. |
100 | | - It is only called if processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process]. |
| 99 | + Called on each idle frame, prior to rendering, and after physics ticks have been processed. [param delta] is the time between frames in seconds. |
| 100 | + It is only called if processing is enabled for this Node, which is done automatically if this method is overridden, and can be toggled with [method set_process]. |
101 | 101 | Processing happens in order of [member process_priority], lower priority values are called first. Nodes with the same priority are processed in tree order, or top to bottom as seen in the editor (also known as pre-order traversal). |
102 | 102 | Corresponds to the [constant NOTIFICATION_PROCESS] notification in [method Object._notification]. |
103 | 103 | [b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). |
104 | | - [b]Note:[/b] [param delta] will be larger than expected if running at a framerate lower than [member Engine.physics_ticks_per_second] / [member Engine.max_physics_steps_per_frame] FPS. This is done to avoid "spiral of death" scenarios where performance would plummet due to an ever-increasing number of physics steps per frame. This behavior affects both [method _process] and [method _physics_process]. As a result, avoid using [param delta] for time measurements in real-world seconds. Use the [Time] singleton's methods for this purpose instead, such as [method Time.get_ticks_usec]. |
| 104 | + [b]Note:[/b] When the engine is struggling and the frame rate is lowered, [param delta] will increase. When [param delta] is increased, it's capped at a maximum of [member Engine.time_scale] * [member Engine.max_physics_steps_per_frame] / [member Engine.physics_ticks_per_second]. As a result, accumulated [param delta] may not represent real world time. |
| 105 | + [b]Note:[/b] When [code]--fixed-fps[/code] is enabled or the engine is running in Movie Maker mode (see [MovieWriter]), process [param delta] will always be the same for every frame, regardless of how much time the frame took to render. |
| 106 | + [b]Note:[/b] Frame delta may be post-processed by [member OS.delta_smoothing] if this is enabled for the project. |
105 | 107 | </description> |
106 | 108 | </method> |
107 | 109 | <method name="_ready" qualifiers="virtual"> |
|
0 commit comments