Timing with FixedUpdate

I have a system that must keep in movement synch with regular PhyX moved objects. So, I use [DisableAutoCreation] and call Update() on my system from FixedUpdate().

However, I think I have misunderstood Time.DeltaTime (previously Time.deltaTime in old versions of ECS). I have been using it like Time.deltaTime in monobehaviours. I think they are very different.

In U2019.4 and Entities 0.11.0 it “appeared” similar ~ 0.02 seconds (sometimes more, sometimes a bit less). However, in U2020.3 and Entities 0.17.0, Time.DeltaTime is more like 0.007 to 0.01 - which obviously wreaks havoc with my DOTS movement code.

Given I call Update() in my system from FixedUpdate(), should I be passing Time.deltaTime to my system and using that instead of Time.DeltaTime?

BTW - the reason I don’t use the newer FixedStepSimulationGroup is that I need the movement to be kept in step with the PhyX world, not just use the same step size.

Yes, or you can use UnityEngine.Time.fixedDeltaTime to be more explicit.

1 Like