[Solved]Scenes Help

The project I am working on consists in Outer Space. And now I am confused.

I have placed a phase gate in the scene to allow travel to a new star system. How do I create NEW scenes, and link each scene via the phase gate?

I’m lost, any help would be appreciated. Thanks in advance.


(Note: I am still NEW to Unity, and am using the Unity Free version).

Control-N to create a new scene (command-N for Mac) but still confused on linking the scenes via the phase gate

You have to create a script and attach it to your phase gate.

Something like this in pseudo code;

If Player collides with the Phase Gate Collider
Application.LoadLevel(Nextlevel Number)

And they can arrive at any location the phase gate is located in the next scene, and they can return to the previous scene they were just in?

On the new scene, place your player prefab where you want them to appear and when the new scene is loaded they will start right there.

But returning to the last scene and appearing in the last position takes some work. Easiest way would be dublicating the first scene WITH the player in the phase gate position, but it’s not practical if you are planning to place a lot of gates and you will have a lot of levels.

There is also a command called DontDestroyOnLoad()

You can store the last position of the player in a variable, and when you turn back to the first scene, you can position the player using that Vector3 variable in Awake()

There are a total of 15 maps in the first galaxy. Each one having 1 or more phase gates to take you to different systems.

I would probably only want the starting star system (for each race) not destroyed. Every other system would be fine, based on the previous statement you said above…

Yep, you are welcome :slight_smile:

Thanks!