Hello I’ve been running into an issue where my game’s physics is noticeably different running in editor vs build. The gravity was slower in the build version due to the v-sync and update rate. When digging deeper into the issue, I come across the timeStep variable in the StepPhysicsWorld.OnUpdate function. This variable is set to UnityEngine.Time.fixedDeltaTime unless when built as a DOTS Player where it uses the local Time object. Is this an issue since the recent versions of the Unity Physics package run in the variable update group? Because once I changed the code to use the Time variables DeltaTime, it seemed to work appropriately in Editor and runtime.
1 Like
Physics simulations tend to prefer a fixed time step especially for constrained setups. If the variability isn’t too bad using deltaTime rather then fixedDeltaTime should be fine (see [this post]( Unity Physics Discussion page-18#post-5027081) if you don’t want to change the Unity Physics code itself). If one frame is significantly different than the previous you can get jittering and constraint violation.
I changed the timestep to DeltaTime prior to posting this, I just didn’t know the repercussions and if it was the right call to change it. The post you sent is really helpful, thank you, @steveeHavok !