Skip to content

Latest commit

 

History

History
35 lines (26 loc) · 601 Bytes

UNT0004.md

File metadata and controls

35 lines (26 loc) · 601 Bytes

UNT0004 Time.fixedDeltaTime used with Update

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.