How to keep physics consistent?

To start of, my game is pretty physics heavy, as it’s a racing game with high speed moving vehicles. Also, it runs on iPhone/Android, so I have to find a good compromise.

My first question is regarding the “Fixed Timestep” and “Maximum Allowed Timestep” settings. My current settings are as follow:

Fixed Timestep: 0.02
Max Allowed: 0.1

I can get away with 0.03 but sometimes, the wheel colliders go through the ground, so I have to add Sphere Colliders to my wheels as well to keep them from doing it. I went back down to 0.02 because my frame-rate is still over 45-55 even at that value, so I might as well have better physics simulations if I can afford it. I was wondering, for you guys that are developing physics heavy games on mobile devices, what settings seem to work best for you?

My second question is about physics calculations in FixedUpdate. I have been developing my game, for the most part, at a Fixed Timestep of 0.03, and now that I lowered it to 0.02, my physics calculation are “stronger”…for example, I have a “Spring” function that basically does this in Fixed Update:

springPower = 5000f;
transform.rigidbody.AddRelativeForce( ForceDir * springPower, ForceMode.Impulse );

With a Timestep of 0.02, that force is stronger and pushes my vehicle higher into the sky then with a Timestep of 0.03, which is normal behavior correct? How can I force that calculation to always apply the same amount of force regardless of the Timestep value?

That’s it, thanks for your time guys!

Stephane

Can’t you multiply by the Time.fixedDeltaTime so that only a certain amount of that force is applied based on the delta. So a larger delta between time steps applies more force per step and a smaller time step applies less. Does that make sense or did I just lose my mind? Sorry I’m distracted right now :frowning: