Negative timer problem
Michi9298
Member, PRO Posts: 12
Hie everyone
I need some help.
I have a 60 sec timer for my gameplay. Once the timer hits zero it changes scene to game over . However when im testing it on my device in some cases the timer just keep going after 0 into negative.
anyone know how to fix this ?
Comments
Make a rule that if the timer > 0 every 1 second -1 from the timer.
Or you could constrain the attribute. If Timer <= 0 constrain timer to 0.
Only run the timer when it's above 0.
So, if timer > 0 then . . .
timer.
These would be doing pretty much the same thing, working away in the background to produce nothing useful, both timers and constrain behaviours are fairly resource hungry, it probably not best to leave them running if they are not producing anything, it would be less strain on the game to have the timer only work within a certain condition, if that condition is not met then it stops working.
Thanks both of you ! worked like a charm !