Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: yaozhe999 on December 14, 2011, 10:36:50 PM
-
how can I pause playmaker?
I'm working on a 2D action game, and when I press esc key I want to pause the game to show menu,but I can't find a way to pause playmakerFsm...
so is there any way to pause playmakerFsm on its current state and resume ?
-
Hey, have an FSM that has these:
Action1:
-Wait for key down - ESC
Action2:
-Scale time - 0
-Send event -link to your HUD FSM to enable it.
-
There currently is a solution
PlayMaker Window>FSM tab (next to State, Events, and Variables Tab)>Untick 'Reset On Disable'
-
According to fromfame you can Untick 'Reset On Disable' and when you want to pause FSM then disable FSM. when you enable its start with the same state. sorry for my bad English.
-
Hi.
There is also a different way :
Make a "Pause" state.
Set a global transition to the state (call it Pause for example)
In the state place the action "Get Previous State Name" and set a variable to store the name.
Then set a transition to another state to un-pause.
In that state place the action "Go To State By Name" (you can find that action on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181))
1 difference is that the selected state would restart and not continue (which can be good or bad, depending on your setup)
for example if you would have a wait (3 sec for example) on the action when paused
When you un-pause (and wait would have 1sec left)
The time would count again from 3sec.
While the suggestion from 'fromfame' and 'play_edu'
The time would continue from where it got disabled (1sec)
also the actions that are "Finished" will not be called again.
I think both ways can be useful in different situations so i thought i mentioned this solution also :)