I’ve noticed that the general consensus on ticks is to never use them unless you can’t get around it, and to use timers instead. However, my main concern with timers is when you have to constantly start and stop them. I’m guessing that using tick is better than timers in these cases as there may be some performance cost in starting and stopping them.
An example scenario: I want to update the rotation of a character’s mesh to face its velocity. Sometimes the velocity will not change, so the rotation will not change.
Assuming that calculations are semi-expensive and do not just set the mesh’s rotation to the direction of the character’s velocity, would it be better to:
- Throw all logic into tick
- Throw all logic into tick, but add a check to only perform updates when mesh rotation does not equal the direction of velocity
- Start a timer with interval 0.1f whenever the direction of velocity changes, and end the timer when the mesh’s rotation matches velocity