Go back to previous scene?

Hi everyone,
I’m trying to get the character to go through the red door, switch to the “Pain Scale” scene, and when they go through the green door, go back to the main scene from the green door and not from the beginning of the scene.

I really don’t know if the game allows to do something like that. Until now I’ve tried using the event “Stop the scene and go back to the previous paused one” but this does not work, it just repeats the same scene “Pain Scale” over and over again.
Does anyone know if it is possible to do it this way or is there some other similar option to return to the scenes?

This is how Pain Scale scene looks, so that green door is the exit to the Game scene:

This is the event that i used to go back to the Game scene:

Maybe, change the global variable called room1_x to the x position of Player while he is on that green door
and change the global variable called room1_y to the y position of Player while he is on that green door
Now, in room1, check if the scene is just resumed, and change the Position of Player based on room1_x and room1_y

1 Like

Finally i tried it with variables, but it is something that I still don’t understand very well. What I did was just put everything in the same event and now I can go back to the main scene from the same door from where it came out.
Thanks for your help anyway!

1 Like

I’m assuming you’ve got a collision check between player and red door, and the action to pause current scene and start the Pain Scale scene? If so, then the problem is probably that when the scene resumes, the player is in the same position, and in contact with the red door. At which point it would open up the Pain Scale scene again.

Move the player character to the green door on the main scene before you switch to the Pain Scale scene.

1 Like

What @Muzan meant was to use this condition in the main scene :


However, if you move the player before changing scenes as I suggested previously, you won’t need to store the position and faff around with variables.

As a general reminder, you should always use a Trigger once condition whenever using a change scene event.

I’m not seeing that in any of the screenshots, and likely is some of the source of the issue.

Why is that? Is there a chance of the scene get run a second time, implying the change scene is run synchronously?

Or is the trigger state stored when the scene is paused, so when the scene is resumed the trigger condition has been ‘remembered’?

A few reasons:

  1. With the events in the first screenshot in this thread, the scene is being paused with the user in collision with the activation box. Meaning that as soon as they come back to this scene it is immediately going to pause again and go to the other scene.
  2. In many cases it can try to change scenes infinitely before it actually changes it over, causing either a freeze or nothing to happen (this is with any change scene event)

Hi. all , variables are your friends all this can be solved just add a scene variable or an object variable to the greendoor object so later just check

if player is in collision with greendoor
greendoor variable open = false
Do your stuff here for a collision with the greendoor closed.

if player is in collision with greendoor
greendoor variable open = true
Do your stuff here for a collision with the greendoor open.

Maybe you need to add some Storage for the greendoor so you can manage the state of the door at the begin of the scene.

1 Like

Thanks, this worked very well adding trigger once every time I did the scene change.