UNT0004 Time.fixedDeltaTime used with Update

December 11, 2019 ยท View on GitHub

Update is dependent on the frame rate. Use Time.deltaTime instead of Time.fixedDeltaTime.

Examples of patterns that are flagged by this analyzer

using UnityEngine;

class Camera : MonoBehaviour
{
     public void Update()
     {
         var foo = Time.fixedDeltaTime;
     }
}

Solution

Use Time.deltaTime:

using UnityEngine;

class Camera : MonoBehaviour
{
     public void Update()
     {
         var foo = Time.deltaTime;
     }
}

A code fix is offered for this diagnostic to automatically apply this change.