How to pause a timer?
I have a timer that counts down, but i want the timer to pause when the pause button is pressed. (when the pause button is pressed, it spawns an actor). I don't want anything else to pause, just the timer? How would i go around doing this. Thanks.
![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
Comments
In your timer:
Wrap your timer rules etc in a rule that says:
When attribute game. Paused is false.
In your pause actor:
When touched is pressed:
Change attribute game.Paused to true.
Hope this helps.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
I have just the same problem. I do a timer as in the example of the TShirtBooth-Video.
So then I wrap in my timer all in the rule and put it "When attribute game. Paused is false".
On my pause-button I put then when it will be pressed, that the change attribute game.paused to true.
In my pause-scene (I have no pause-actor but a pause-scene) I put then in the button to go back to the game the change attribute game.paused to false.
So the result is that the timer starts, when the game starts.
If I put the pause-button, then the timer will not be seen through the 50% transparent-pause-Scene, but ok. When getting then back to the game by pressing the back-to-game button, then the Timer start again at 60 seconds (my timer counts all the time in the level from 60 back to 0).
What must I change there?
How can I pause the timer, when I change my game-status in the pause-mode (clicking the pause button, change the scene, pause game)?
Maybe some expert can verify that.
I'll try your suggestion:
Integer attribute counter = counter - 1 every 1 sec
Is there a problem using REAL instead of INTEGER?