Time.deltaTime question.

When I press the play button to test my work is that based off of a timer like ‘1 second / 30’, or is it in a free run? If it were a free run I would guess that it would run as fast as the computer could?

While investigating this I came across Time.deltaTime quite a bit but the returned value is how long it took to finish a frame. I entered this in to a print function and it returned different values around 0.01638907. When I multilayer this by 60 it got very close to 1.0, that makes me believe that the game speed is 60fps?

I am guessing here with this piece of code from a tutorial

transform.position += transform.forward * moveSpeed  * Time.deltaTime;

by multiplying deltaTime every loop any frames that take longer to finish would allow the transform.position to move the object further alnog what ever axies. So shorter frames would move less but the loops would be quicker. This would allow for the same amount of distance to be covered if the frames took a lot longer or much shorter to complete?

Am I understanding that?

The game framerate is whatever. It could be 60fps if your monitor has a 60Hz refresh rate and you have vsync on, though it can always go lower if you have more intensive things going on. Anyway yes you have the correct understanding. Make sure to look up Time.deltaTime in the documentation though.

–Eric

Thanks Eric… I did read about deltaTime but it is very short and I did not follow exactly. But it sounds like I figured it out from your reply. Unity - Scripting API: Time.deltaTime