Pause System
Use these actions to pause and resume the whole game in a safe, shared way.
Instead of directly setting Time.timeScale yourself, PlayMaker tracks pause requests from different systems. That means a pause menu, popup, cutscene, or tutorial can all request pause without stepping on each other.
Actions
Add a pause request. When the first request is added, PlayMaker pauses the game and sends OnGamePaused.
Remove a pause request. When the last request is removed, PlayMaker resumes the game and sends OnGameResumed.
FSM Pause Mode
The FSM Pause Mode setting in Advanced Settings controls what an FSM does while the Pause System has paused the game.
There are two modes:
Run When Paused: The FSM keeps updating even while the game is paused.Pause With Game: The FSM stops processing its normal updates and regular events until the game resumes.
Why This Matters
Pausing the game sets Time.timeScale to 0, but not every FSM should behave the same way during that time.
Use Run When Paused for things that should still work while gameplay is frozen, such as:
- Pause menus
- Settings panels
- UI animations that use unscaled time
- Logic waiting for
OnGameResumed
Use Pause With Game for gameplay FSMs that should freeze with the rest of the game, such as:
- Player control
- Enemy AI
- Combat logic
- World interactions
Important Behavior
When an FSM is set to Pause With Game:
- Its normal update loop is skipped while the game is paused.
- Regular events are ignored during the pause.
- It can still respond to
OnGamePausedandOnGameResumed.
This makes it easy to freeze gameplay logic while still allowing the FSM to react when the pause starts or ends.
Example
A player controller FSM is set to Pause With Game:
- A pause menu uses Pause Game.
- The player controller stops updating while the game is paused.
- The controller can still receive
OnGamePausedif it needs to switch to a paused state. - When the menu closes, it uses Resume Game.
- The controller receives
OnGameResumedand continues running.
Why Use Pause Requests?
The Pause System uses pause requests instead of simple pause and resume commands because more than one thing may want the game paused at the same time.
Imagine the player opens a pause menu, then a confirmation popup appears on top:
- The pause menu uses Pause Game.
- The popup also uses Pause Game.
- The popup closes and uses Resume Game.
- The game stays paused because the pause menu still has an active pause request.
- The game only resumes after the pause menu also uses Resume Game.
If pausing worked like a single on/off switch, closing the popup could accidentally resume the whole game even though the pause menu was still open.
The request-based approach avoids that problem. Each system is responsible only for its own pause request, and the game resumes only when all pause requests have been cleared.