What is the value of Time.delta time before finish rendering the first frame
Hi, I'm having some problem with Time.deltaTime and loop.
Time.deltaTime is The completion time in seconds since the last frame according to the documentation, but what is its value before finishing the first frame? I'm assuming it is 0. In that case if I have a script like this, it should be an infinite loop since Time.deltaTime is always 0 in first update function, but I can start the game normally. So what is the answer of my question and what exactly is A frame?
Thanks in advance.
float timer = 0;
void Update()
{
print("rendered frame = " + Time.frameCount);
while (timer < 1000f)
{
timer += Time.deltaTime;
print($"for {Time.frameCount} times update function, timer = " + timer);
}
timer = 0;
}
Comment
Your answer
Follow this Question
Related Questions
Breaking out of the right loop 1 Answer
Loop in coroutine stops after going halfway 2 Answers
Round Loop Problem?... 1 Answer
Can't figure out how to make this work without it looping? 0 Answers
Loop just executes once 0 Answers