- Home /
Application.LoadLevel wont work
I've used Applicaiton.LoadLevel to load my levels form the main menu and submenus as well as when my levels time finishes it boots you back to the main menu. However i have a subroutine that detects when you are under water and will also boot you too the main menu.
void OnCollisionEnter(Collision collision){//detects collision with an object if(collision.gameObject.tag == "Gun"){//searches for any object tagged "Tank" Debug.Log("The tank is in the water and will be destroyed"); //prints debug message when tank hits water. Application.LoadLevel("MainMenu");// sends player back to main menu if they go under water } }
this subroutine as far as I can tell should work. The debug log text shows in the console but the loadlevel never occurs. Anyone know why?
Your answer
Follow this Question
Related Questions
Application.Loadlevel("Level Name"); not working on android 2 Answers
Weird behaviour in Application.LoadLevel() 0 Answers
How to create a complicated game over scene ? Help 1 Answer
Teleporting/application.loadlevel 1 Answer
Play Scene help 1 Answer