Tick Group/Tick Dependency Usage Example
As an example of how to use each of the tick groups listed above, imagine a game where the player controls an animated actor who aims a laser, which places a special targeting reticule actor
at the point of impact. A special meter fills up as long as the laser stays pointed at a certain type of target object, and a HUD actor displays this meter on the screen.
The player's animated actor would move and animate in TG_PrePhysics. It needs to animate before physics in order for physics-simulated objects to follow and interact with it correctly.
The HUD can update in any tick group, but TG_DuringPhysics is a good selection for two reasons. First, TG_DuringPhysics is acceptable because it doesn't directly interact with, or use data from, the
game's physics simulation. Second, it is a good idea because there is no reason to force physics simulation to wait for the HUD to finish updating, nor is there a reason to force the HUD to wait for
physics simulation to finish. Note that the HUD will be one frame behind the game, i.e. pointing at a target object this frame will not be reflected in the meter until next frame.
The reticule actor would update in TG_PostPhysics. This way, the reticule knows it is tracing against the scene as it will be rendered at the end of the frame, so it knows that it will appear exactly
on the surface of the object as intended. It also knows that it will adjust the meter value based on the correct locations of target objects.
Finally, in TG_PostUpdateWork, the laser particle effect would be updated with the final locations of both the aiming actor and the reticule.
Tick dependency can be used to eliminate the need for TG_PostUpdateWork. The laser particle can be placed in TG_PostPhysics along with the reticule actor, using tick dependency to ensure that the laser
is updated with the reticule's location only after the reticule has had a chance to tick. By setting the laser's tick dependency to the reticule, we can ensure that the laser isn't updated too early, but
without waiting for other post-physics ticks that aren't relevant. This can be more efficient than moving the laser into a different tick group.
As an example of a case that would not benefit from tick dependency, the reticule itself does not need to be tick-dependent on the aiming actor, even though it needs the aiming actor to have finished
ticking before it can do its own tick. The reason that tick dependency is unnecessary is that the reticule is in post-physics while the aiming actor is in pre-physics. Because they're in different tick
groups, we can be assured that they will always run in the order of the groups themselves, since each tick group completes ticking all of its actors and components before the next tick group can begin.