Load Level

Just have a quick question. Say you have a 3D room that has 2 doors on to the north and one to the south. Each door when clicked loads a level (Room) that corresponds to what is behind that door. Now say you click the door to load back the level with the 2 doors. how do you position the player(FirstPersonController) to the door that they just came through.

If I clicked the north door and went to the north room then clicked to go back the player should be by the north door and if I went through the south door and then back the player should be located at the south door.

My question is… Is it possible to change the start position/rotation of the player for each level that is loaded instead of the start position done in the unity designer?

thanks for any help…

Why don’t you have a single scene with different rooms spread through out the scene? You could keep empty gameobjects by the doors and when you want the player to move there, just change his position to that of the empty gameobject.

If you still insist on using different scenes, look into this. You could store what door the user chooses and when loading the scene, set the player’s position accordingly.

Awesome! thanks for the reply!!!

you can use static variables too
if you don’t know about static variables, they are variables that you can use them without instancing their class and they will create at first of program execution and never die

it’s a good idea to have this kind of static classes or manager objects (objects that don’t destroy between scenes)

but in you problem’s case having one scene is the best idea unless you want to load them on the fly from the web.

hope this helps