Question by
unity_yi4IzX0fVBTBFg · Jul 09, 2021 at 09:41 PM ·
scripting problemsimpletimer-script
Float timer not working
I've got a super simple timer to do something after a delay has passed but for some reason it's not working. I've used this exact same method before in a different script and it works fine.
float Timer = 0;
Update(){
Timer += Time.deltaTime;
if(Timer >= 15){
DoSomething();
Debug.Log(Timer);
Timer = 0f;
}
}
For some reason when debug logs the timer value in the console it only shows the delta time and doesn't count up. I even tried writing it out a different way but it gives me the same output
Timer = Timer + Time.deltaTime;
This it literally the only thing left for the current milestone of my project and for some reason it has me hitting my head against a wall.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613040108im_/https://answers.unity.com/themes/thub/images/avi.jpg)