Event Tick
Outputs | |
---|---|
Delta Seconds | Amount of time that has passed since the previous frame. |
Overridable in almost all classes that can exist within a level.
Overview
Event Tick is called once per frame and has various ways to modify when and even if the tick occurs.
Since Tick is dependent on the frame time, care must be taken when driving certain functions and systems.
Having too many objects using their Tick to call many functions can cause a drop in performance.
Implementing essential game logic and not making it independent of the frame rate can cause issues.
Defaults
An actor's tick is, by default, enabled and happens during the Pre-Physics stage of the engine's Update Loop. Unless changed, it only occurs once the actor has finished their BeginPlay event.
Parameters | |
---|---|
Start with Tick Enabled | Causes the object's Ticking Enabled variable to be set during its creation. |
Tick Interval | Sets the frequency that the object will Tick. (Zero causes a Tick in each frame) |
Allow Tick Before Begin Play | Enables the object to Tick before its Begin Play Event has occurred. |
Tick Even when Paused | Allows the object to continue Ticking when the game has been paused. |
Allow Tick on Dedicated Server | Enables the object's Tick while existing on the Dedicated Server. (Objects do not tick by default) |
Tick Group | Selects the Tick Group that controls the object's Tick. This affects the order of the Tick during a frame. |
Frame Rate Independence
If Tick is needed for a particular function, there are ways to ensure the frame rate does not impact the game logic.
The Delta Seconds output allows you to normalize your calculations based on the time between the last frame.
Usually, this is done by using Delta Seconds as a factor and scaling down any movement or timings based on the previous frame.
Examples
Delta Seconds
Prints out the current Delta Seconds during each frame.