Should we use Time.deltaTime in FixedUpdate

I know this question has been asked once Is it even necessary to multiply by Time.deltatime in fixedupdate - Unity Answers but it looks as though it has not been settled.
The first few answers only talk about how AddForce shouldn’t have Time.deltaTime because it has it inherently. The last answer(as of now) by FrimaMickD says not to use Time.deltaTime inside FixedUpdate and it makes sense to me because no matter what computer, FixedUpdate will be called at the same rate all the time(as far as I know, quote me if I’m wrong) and Time.deltaTime is there to remedy problems that could occur inside the Update function because framerates may vary over time, and on different computers. However, I’ve seen official Unity tutorials using Time.deltaTime inside FixedUpdate and also in the comment section of FrimaMickD’s answer it looks as though sb is suggesting that Time.deltaTime needs to be used inside FixedUpdate in certain cases.
Can someone please resolve this issue it’s been driving me crazy.

Here is the answer:
“For reading the delta time it is recommended to use Time.deltaTime instead because it automatically returns the right delta time if you are inside a FixedUpdate function or Update function.”

So yes, use Time.deltaTime :wink:

Cheers

If you move a transform by modifying its position directly then use Time.deltaTime. If you want any time based effects use Time.deltaTime.

Don’t use Time.deltaTime with forces, forces are not a time based effect.

This advice is true if you are using Update or FixedUpdate.

Well, use Time.deltaTime inside your FixedUpdate() if you want to include how many seconds the previous frame took to render. There is a Time.fixedDeltaTime which tells you the time between fixed updates. Since I’ve never seen any fixed update code that needs to know how long the previous frame took, I’d say don’t use Time.deltaTime inside a FixedUpdate().

Time.deltaTime returns Time.fixedDeltaTime in FixedUpdate(). You can try it :wink:

Offtopic but I think Time.fixedDeltaTime could be used for coroutines if it is used for some sort of physics calculation.

IEnumerator MoveTowardsWaypoint()
{
            while(doLoop)
            {
                transform.position = transform.position + direction * Time.fixedDeltaTime;
                yield return new WaitForFixedUpdate();
            }
}

I came here because, after altering the frame rate of my application when running on mobile, I found that Input.touches.deltaMove was returning a different value. Using that value for forces in FixedUpdate() was giving incorrect results.

The solution turned out to be dividing by a constant (the original frame rate that I had tweeked the code for) and then divide by Time.deltaTime.

It’s a possibly niche case but I thought I might be worth recording here.