- Home /
How to end the game
How do you trigger the end of the game when you leave a certain area. Because once you leave the area in the level on my game, that is the end. How can you do this? Any help is appreciated.
Answer by Sisso · Nov 07, 2012 at 08:49 PM
Use a trigger to detect :
http://docs.unity3d.com/Documentation/ScriptReference/Collider.OnTriggerEnter.html
Use a LoadLevel to change to the end scene:
http://docs.unity3d.com/Documentation/ScriptReference/Application.LoadLevel.html
thank you. but may i ask how you load up the main menu, rather than the end scene, as it goes straight back to the main menu?
I also didn't understand. What did you mean with $$anonymous$$ain$$anonymous$$enu? If you are speaking a Scene with contain the $$anonymous$$ain$$anonymous$$enu, still use Application.LoadLevel.