Answer the question
In order to leave comments, you need to log in
Does Time.deltaTime always equalize the total time?
Here in my prefabs I need to add a counter every second, let's say
private float TM = 0, TMSpeed = 1f;
private int Counter = 0;
void Update(){
TM += Time.deltaTime;
if(TM > TMSpeed ){
TM = 0;
++Counter;
}
}
Answer the question
In order to leave comments, you need to log in
No. You will 100% be wrong.
Look, let's say deltaTime = 0.9
Then the values in the update are 0.9, 1.8.
At 1.8 you will string, and then you will nullify the value and lose your 0.8 - almost a second!
But if we talk about "uniformity on prefabs" - then yes, update is called sequentially for all active objects, and everyone will have the same deltaTime - the time of the PREVIOUS frame (please note, not the current one), and until all objects are updated - the next frame will not start.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question