How to pause a main time?

makarone

  • Posts: 15
HI i have an issue.
In my project i'm using an event that spawns actor types  "after time" ( do after time- 30 sec).
When i'm  pausing the game for  ~20 seconds at the begining of the scene.
Actor type appears after 10 seconds after  game was unpaused.
But he must appear after the 30 seconds.
It seems like Pause function didn't works for that and time still counts. 
Can you help me?
Thanks.

rob1221

  • *
  • Posts: 9473
There's probably some code you can use to pause a timer, but I don't know what it is.  A workaround is using a counter that spawns an actor when it reaches a certain number.  For example, you can increase the counter every 1 second and when it reaches 30, reset it to 0 and spawn the actor.  You'll also have to check if the game is not paused before increasing the counter.

makarone

  • Posts: 15
Thanks for the Quick response Rob.

Sorry, i have made a little mistake.

I said that i'm using a "do after time" but there is a  " Do every [30]  seconds" block.

I tried with these code blocks:

do every [time]+30

Time- it's a game atribute , number.
it counts +1 every second.

But it still wont stops.

rob1221

  • *
  • Posts: 9473
Timers in scene behaviors don't pause.  You have to check if the game is not paused (there's a block for that) first.

makarone

  • Posts: 15
Thanks! Problem solved!