Warp from scene1 to scene2 problem - please help me :)

Hello! I am trying to warp my player from scene1 to scene2 but i have a problem with my player position.

What i do:

  • player object has only movement behavior and is a global object
  • player object is standing in the middle of scene1
  • collision object is on the left side in scene1

in scene1 i have an event ‘collision’ (collision object vs player object)

in scene1 i gave this event these actions:

  • ‘change the scene’ > to “scene2”
  • ‘position of an object’> choosen player and coordinates where it should appear in scene2 (on the right side of the screen)

The player does not appear. Can somebody tell me what i do wrong?


Take a look on debbuger (launch preview with debugger then click “refresh”, and look if your object “player” is existing in the scene, and check his coordinates, maybe he just spawns outside of the screen, or at bad layer/Z Order).

This might be helpful if you could provide some screenshots.

Hmm i looked at it but sounds difficult, i am real beginner…I understand you can do things many different ways. That also makes it difficult for me. Is there a tutorial about switching scenes and warp the player? I cannot find it :frowning: think it would make it al more clear for me. Thanks!

As soon as you trigger the “change the scene” action, the new scene will load, so your action to move the position of the player won’t happen as it is part of the old scene. You would need to put that action in the “At the start of the scene” event for scene 2. You would also need to manually place the player object somewhere in scene 2 (doesn’t matter where), so it exists to be moved.

The idea that the player object moves from scene to scene unchanged is just an illusion that the person playing the game experiences. Each scene is separate, so as the game creator you do need to make sure everything is there in the scene.

I think that something very important must be explained here: Set an object as “global” just make it so every scene can access this template object to create instances, a global object doesn’t make the instances to move from one scene to another :slight_smile:

Global objects are useful during development only, you make your player as global and use it in a lot of scenes, the if you want to add an extra animation to the player add it once and the change will be reflected in every scene (if the object were not global you should add the animation to every player object on every scene).

What you want to do, as others have explained, is done adding the player instance on the other scene too, if there is information that the old player instance has (health, experience, etc.) you’ll have to pass it to the new instance through global variables :slight_smile: