SceneManager

Hi all! And thanks in advance!
I am working on a game that loads different scenes … but every time I change the scene, the player’s starting position is repeated …
I don’t know if I explain myself …
Imagine that we are going through a street (A), and we want to enter a house (B). To return to the street and have the player at the door of the house, instead of resetting the player?

Create an empty game object in the position and rotation that you want the player to start in. Then write a script to find the player and set the players position and rotation to the same as the object. Alternatively, you can work the other way around and have the player find the starting point.

Edit: another strategy I use is to have my player, camera controller and game manager-type-stuff in a separate scene that’s always loaded when the game is running. Various locations like the street and the house will be in their own separate scenes that I can load and unload additively as you walk around. That way I don’t have to worry about preserving the player and game state between scenes.

1 Like

You can use collider to trigger the spawn points