Unity Delta Time

In by John FrenchPublished Updated

In Unity, Delta Time is a static float value that returns the duration in seconds between the last frame and the current one.

Delta Time can be accessed using the Time Class and is typically used to measure time, delays, and time intervals, and to scale movement or value changes so that they occur independent of frame rate.

For example a common use of Time.deltaTime is to convert a movement value from units per frame to units per second:

[SerializeField] float moveSpeed = 10;

void Update()
{
    // Moves an object forward at 10 units per second
    transform.position += new Vector3(0, 0, moveSpeed * Time.deltaTime);
}

See also