If you put a physics code into FixedUpdate()
, e.g. rigidbody.AddForce(force)
and your fixed timestep is set to default 0.02
(50 FPS) then your code will be executed 50 times per second. But if you decide to change fixed timestep to 0.01
(100 FPS) the same force will be applied 100 times a sec so it’ll have effect at gameplay.
If this happened mid-development, it could break the game and the only way to fix it would be to figure-out all the force values (in the inspector) yet again.
Is there a way to make physics calculation in FixedUpdate()
independent from fixed timestep? Similar thing can be done for Update()
by using Time.deltaTime
but it doesn’t seem to work in FixedUpdate()
.