Hi All,
I’ve recently been trying out a workflow where I’ve avoided placing things in tick by running simulated ticks for certain mechanic states.
The workflow for each mechanic works as follows:
StartMechanic (called from input if criteria such as state is all good)
MechanicSimulatedTick (called once on end of Start Mechanic function, and then calls to self for next frame via SetTimerForNextTick) (once the mechanic is over, it just stops running).
I’ve found that there is a large behaviour difference between the logic when run via tick and run via SetTimerForNextTick.
For instance, my MechanicSimulatedTick sets the actor location each “simulatedTick”. It’s super choppy (despite delta seconds etc being correct).
If I then remove the call to it from start mechanic, and it’s call to self (setTimerForNextTick) and call it from Tick instead (based on state system) - the SetActorLocation runs smoothly, no problems.
Why might this be the case? Surely they’re both being run on tick. Is it a tick group error for the actor? I know timers are invoked before most of the updates, and by default an actor is ticked PrePhysics.
UPDATE: Looks like the issue might be that timers are invoked between PostPhysics and PostUpdateWork. This would mean that all my movement of the character during that invoked function is running after physics has already run
Seems like there should really be an option to specify when a SetTimer is run (choosing a tick group)