Swapping between Scenes without affecting objects position.

How can I have object appear at the same position as it was before i swapped between two levels?

Lets say in level 1 I have cube in the middle of Scene, I push it into corner and load level 2.
Then I come back (load) level 1 but the cube appears back in middle.

I appreciate any suggestions.

There are (at least) two ways of doing what you need:

  1. http://unity3d.com/support/documentation/ScriptReference/Object.DontDestroyOnLoad.html ← setting this in the Awake() (or whatever) function of your object will make it persistent through scene loads/changes. Just bear in mind that you’ll have to manually destroy it when you want it gone.
  2. Save the object’s coordinates, and reset them when the scene loads again.

Either method requires a little extra coding, but neither really is very hard :slight_smile:

I forgot to mention that I am using DontDestroyOnLoad.
The only problem I have with that is that when I return to first Scene it positions the object into its default position and not the one I left it in.

To make more sense of it - it is like if I had chair in the middle of room#1 and I moved it into corner, then left into room#2 for a second and then went back into room#1 and finding the chair back in middle of room instead in corner where I left it.
I would either think that I am going crazy or I have ghosts in my house.

Thanks for the reply though.