pause and unpause
djdee
Member Posts: 180
hi,
I tried this custom pause system which was shown by @tshirtbooth
but it does not work well with games like these or where balls are spawned from a canon
I dont wanna use pause which gamesalad provides as it loads a new scene on the current scene.
Is there any alternative method to pause the game??
I tried this custom pause system which was shown by @tshirtbooth
but it does not work well with games like these or where balls are spawned from a canon
I dont wanna use pause which gamesalad provides as it loads a new scene on the current scene.
Is there any alternative method to pause the game??
Best Answer
-
jamie_c ImagineLabs.rocks Posts: 5,772You could use the 'regular' pause behavior and just use and empty (or nearly empty) scene. That way there would be little to no delay for the scene load.
Answers
I think thats the best way to approach this....
You'll need a pause Boolean attribute that is set to true as soon as the pause button is pressed, but before the pause behaviour, and it's that attribute you can use to store the actors position, velocity and rotation before constraining them etc. I think for velocity I constrained it to 0 while it was paused and when I unpaused it I set it back to the value I stored in an attribute before pausing, so that it would continue along it's original path
Thank you. I tried ur method, But still after i unpause , the actor just falls down.
what have i done is, when the pause is false i have constrained position, velocity, and rotation to my attributes, and when the pause is true i have changed attribute of position, velocity, and rotation to my attributes and for 0.2 sec constrain the velocity and rotation to 0.
Hello! I know it's an old post but I don't want to start a new thread on the subject.
My spawned actors disappear when I unpause the game using this technique.
My game starts with pause.atribute (integer) = 0
When I pause, pause.atribute = 1
When I unpause, pause.atrribute = 2
My "spawner" spawns every 3 seconds when pause.atribute = 0 or 2.
I use the changeSecene Behavior the switch from pause.Scene to playGame.Scene and in revers also .
Why do my spawned actors disappear when I unpause?
@djdee Just remember for pausing that the order of operations matters. Lets say if you press the pause button and spawn the pause scene (or something) then change game.pause to 1 then it will do it in that order. If you would change game.pause first maybe that will be better because that will stop everything first and then do what you need to be done. That way there might not be a delay.
@buftea I would try to have pause.attribute only have two states, 0 and 1. Maybe try that and then we can see from there.