Reset scene from pause scene - Multiple levels (scenes)

Jugoslav85Jugoslav85 Member, PRO Posts: 36

Hi, i am having problems reseting my scenes from my pause menu. The issue is that i have levels, and when i play for example level 5, and press pause button, it takes me to the pause scene. There i have a resume and reset button. Resume works fine, the reset is what bothers me.

I have a game boolean attribute called reset scene. When i press the reset button, the attribute is set to true, and in the level 5 scene i have a rule when attribute reset scene is true, reset the scene. The issue is that i don't know how to go back to the level i was when pressing the pause button. For example, if it is one Gameplay scene, i would add a timer after 0.2 seconds change scene to Gameplay scene. This way, it could be any scene.

Best Answer

Answers

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    The Unpause Game Behavior takes you back to the scene you paused from.

  • Jugoslav85Jugoslav85 Member, PRO Posts: 36

    @jamie_c said:
    The Unpause Game Behavior takes you back to the scene you paused from.

    I am doing that, but when i do that, the actors on my scene wont spawn.

    I have done a game boolean attribute called reset scene. When reset button is pressed, unpause game, changed attributes (score,lives etc) to their values and set attribute reset scene to true.

    On my level scenes, i have a rule called when attribute reset scene is true, reset scene.

    Score goes to 0, lives to 5 etc, but actors won't start spawning from the spawner actors which are above the visible scene.

    If i add an actor on the scene with a rule when touch is pressed, reset scene, they spawn as usual, but like this, they won't.

  • Jugoslav85Jugoslav85 Member, PRO Posts: 36

    Never mind, i figured it out somehow. All i had to do is add a rule to my scene saying that when attribute reset scene is true, after 0.1 seconds, change it to false.

    Thanks a lot for your suggestion.

Sign In or Register to comment.