aplication level - return to the same position

I’m doing a building where the player can enter several apartments. Each apartment is a new scene. When he leaves each apartment how do I get back to the entrance of that apartment and not the building? Please help

in a word, you need to learn now about

DontDestroyOnLoad( gameObject );

in that way you can make an object which stays there all the time, it will not go away when you happen to change scenes

in that object you can keep information such as “what door did I just use” etc etc

You ask – where to put an object with “dont destroy on load” ?

it’s up to you … I suggest just having an object “ControlSystem” (or whatever). Your hero can get info from that object whenever he needs to.

for instance inside “ControlSystem” there could be a variable “the last door I used” … “which direction am I pointing” … or whatever you need.

Note that SOMETIMES you can actually just make the hero “dont destroy on load”. that’s often the cleverest solution. it can be tricky though.

in your hero you would have code somewhat like this:

var controlSystem = GameObject.Find("ControlSystem");
  if ( ! loadOps )
    Debug.Log("disaster!  could not find the control system!");

That’s the critical code. Then, you can do things like this

my score is... controlSystem.score

i should be pointing...  controlSystem.MostRecentHeadingOffNorth

i have collected the bronze star .. controlSystem.hasShieldsAlready

You get it ?

be sure to TICK any helpful answers OK. It’s the round tick button … under the thumbs. Only you can do it. Also it gives you credit as a new user so you can not get moderated etc.

i’m also using this sort of script but every time i return i end up with 2 players instead of only the original one.