- Home /
How do I change scenes when pressing a "play" button?
I want to create a menu for my game, but I don't know how to link options like "play" or "settings" to another scenes (levels of the game, etc.), or maybe just turn to another camera. How it works?
Answer by $$anonymous$$ · Mar 12, 2013 at 05:20 AM
Application.LoadLevel is the method you are searching for.
Answer by uberokeer · Mar 12, 2013 at 05:27 AM
If You want it to do it when you hit a specific button then do this:
function OnGUI(){
if(Rect(15,15,200,100), "Load Level"){
Application.LoadLevel("SceneName");
}
}
Make sure You put you're scene name in the quotation marks.
But that up there is just for screen GUI if You want it on a 3d object then:
function OnMouseDown(){
Application.LoadLevel("SceneName");
}
But,when I am using Application.Loadlevel() for andorid ,scene is not loading.I have a terrain in main menu(level0) and another terrain in level1.Can u please help me in this @uberokeer
Your answer
Follow this Question
Related Questions
switching scene, first one stops to work properly 1 Answer
How do I make music continue through certain scenes 1 Answer
Options Menu doesnt work after scene change 2 Answers
How do I refer to a gameobject in another scene? 1 Answer
how to make an unlockable object (Pet) spawn throughout scenes after it gets unlocked? 1 Answer