Alright, what we are attempting to create is a Space Sim. The player starts in Sol System (Earth) and can travel through 15 different maps.
We have a phase gate (at least one in each of the maps, maybe more) that will take you to different star systems.
What we are curious, is how do we create the new scene? (which I think I found the answer by pressing control-N) And then link the new scene with the phase gates? We want the player to travel to ANY system using these gates.
The goal is to eventually add mulitplayer capability, but thats far away! Any help would be greatly appreciated, and thanks in advance.
asked Nov 23 '09 at 03:39 PM
You've got the right idea so far. Create all your scenes in the Unity Editor (either with cmd (OSX) or ctrl (Win) + n or from File->New Scene).
Create the scene order by opening the build menu (cmd/ctrl + shift + B or File->BuildSettings...) and dragging scenes from the Project view into the build menu. You can change the order by dragging them up and down in the build menu.
You can now load new levels using the Application.LoadLevel() function. You can use either the scene name or its order in the build settings to determine which level to load. A simple example follows:
Where "levelToLoad" is either a scene name (enclosed in quotes) or a number. The variable can be set in the script or in the inspector when the script is added to some GameObject (in your case, a gate).
One caveat: be sure you've read the collision detection matrix here to ensure you've added the correct components, or else OnTriggerEnter won't fire at all. If you have questions about that aspect of the editor or have trouble understanding the documentation, it would be best to search for or start a new question on that topic. Here might be a useful place to start.
answered Nov 23 '09 at 04:30 PM