Someone can answer me about that please? I’ve already find in script reference but The total number of frames that have passed… I dont understand what meaning O.o
Thanks in advance =)
Each time the Update() function is called, it’s been a frame. In other words, Update() is called once per frame.
Time.deltaTime is a float representing the difference (or the delta) in time (seconds) since the last update (or frame) occurred.
Time.frameCount will give you the total number of frames since you started the game. You could then of course think of this as how many times the Update method was called since the start.
Time.time is the total amount of time since the game started. (kind of like frame count but the units are in seconds rather than frames).
Most of the stuff in Unity runs in the main thread. Everything executes in order which is described here. A frame is one iteration of this cycle. A cycle where you got your Update method called, LateUpdate, after that everything is drawn on the screen — you got one whole FRAME drawn. With current framerate (number of frames drawn per second).
So, Time.time — time when current update cycle started. You can check this value in every method called during a frame cycle (like Update or LateUpdate) and it will be the same. When you press PAUSE this time stops increasing so the game time stops.
Time.deltaTime — basically it is how much time passed since the previous frame. You would usually use it in time dependant activities like moving things with constant speed: transform.position += Vector3.forward * Time.deltaTime; If used in FixedUpdate it is time since last FixedUpdate was called.
Time.fixedDeltaTime — delay between FixedUpdate calls where physics is calculated. Since physics tries to run with constant framerate.
Time.frameCount — the number of render cycles (rendered frames) since the start of the game.
UPDATE: Updated the post with Kryptos’ feedback.
You missed one … Time.fixedDeltaTime !
Everything you want and need to know is here : Unity - Scripting API: Time
for example, click on time : Unity - Scripting API: Time.time
The time this frame has started (Read Only). This is the time in seconds since the start of the game.
now go back and click deltaTime : Unity - Scripting API: Time.deltaTime
The time in seconds it took to complete the last frame (Read Only).
use the search box in the top-left to search all commands/functions/components =]