Negative timer problem

Michi9298Michi9298 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

  • RabidParrotRabidParrot Formally RabidParrot. Member Posts: 956

    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.

  • SocksSocks London, UK.Member Posts: 12,822

    Only run the timer when it's above 0.

    So, if timer > 0 then . . .

    timer.

  • SocksSocks London, UK.Member Posts: 12,822
    edited October 2014

    @Rabid Parrot said:
    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.

    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.

  • Michi9298Michi9298 Member, PRO Posts: 12

    Thanks both of you ! worked like a charm !

Sign In or Register to comment.