Time.time vs. Time.detaTime and Update vs. FixedUpdate
Time.time
Time.time
is a read-only value which is the amount of time after game has been started.
Time.deltaTime
Time.deltaTime
is how much time passed since the last frame. It is a fixed value which you can use for time dependent activities, such as moving an object with a fixed speed.
Update()
Update() is called when every frame is refreshed, the refresh frequency is decided by the physical performance of the machine.
FixedUpdate()
FixedUpdate() is called every fixed time frame, not affected by the physical performance of the machine. FixedUpdate can run once, zero, or several times per frame, depending on how many physics frames per second are set in the time settings, and how fast/slow the framerate is.
Example of using Time.time and Time.deltaTime
The output:
Time.deltaTime
under Update()
:
Time.time
under FixedUpdate()
:
Time.deltaTime
under FixedUpdate()
:
Originally published at https://hackingwithunity.com on August 12, 2020.