If I do:
function Start()
{
while (true)
{
Debug.Log(Time.time);
yield WaitForSeconds(1);
}
}
I don 't get one second intervals printing to the debug log. I get 1 second plus some random variations of Time.deltaTime, such as:
0.0013
1.0145
2.0249
3.0301
But if I pause execution and step through the program one frame at a time I do get exactly one second intervals printing to the console.
Is there any way I can ensure exactly one second intervals with yield WaitForSeconds(1) when executing the program in real time? Or is there some other way to do this?
Thanks for any advice with this.
Mitch