Reseting Timer Without Leaving Scene

I have a timer in my game that counts up and as the time rises the number of bonus points goes down. Anyway, I have a reset button in each scene and I need to reset the timer back to 0 when that button is pressed so that the bonus starts at the beginning again. I don't want to reload the scene, just set the timer back to 0.

I have two game attributes Start Time and My Timer.

At the beginning of each scene Start Time is set to game.time and My Timer is set to game.Time - game.Start Time.

Thanks.

Rich

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited January 2013
    Use self time instead of game time.
  • richcoyrichcoy Member Posts: 211
    Thanks for the video. So if I use a self time instead how would I reset it? Do I spawn a timer at the scene load and then destory and respawn? Seems a little wonky.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    It would auto reset when the scene resets using the reset scene behavior.
  • richcoyrichcoy Member Posts: 211
    Thanks. I'm not using the scene reset function right now but I'll look into that.
Sign In or Register to comment.