Framerate independent physics (FixedTimestep, FixedDeltaTime)

How do I achieve ‘correct’ framerate-independent physics in Unity?

As I understand it; physics logic should always be performed in the FixedUpdate() function (Application of forces, etc), but does this mean I should scale my forces by Time.fixedDeltaTime - similarly to the way we should scale by the [variable] deltaTime in the Update() function for game logic - or is this taken care of by the physics engine its-self?

My reasoning for this is; if the number of required physics steps or the fixed update duration changes, then the forces applied will no longer be correct. However if the physics engine already takes this into account, then there is no reason to do the multiplication myself.

I’ve read a few articles on the topic of physics in Unity, however there seems to be a lot of confusion and misinformation out there regarding how to properly achieve framerate-independence - perhaps this thread can clear some of that up? :slight_smile:

i think it’s not that complicated at all.
Use Time.deltaTime in your FixedUpdate, it will return the fixedDeltaTime when used within FixedUpdate. It’s some kind of Unity shortcut.
You do need to use deltaTime to make your game frame-independent.