- Home /
Title Screen & Scene Help ?
Okay, I have a title screen GUI, And everything, Just Is it possible, That When I click a button, It takes me to another scene?
I don't know how to word it simpler but :
• I have a titlescreen, With : "New Game" ; "Continue" ; "Settings" "Quit"** Now, Is there a script or a tutorial or anything, That makes it so I click New Game And it: A) Takes me to another scene B) Allows you to name the save and it'll automatically save unto Continue
If not, That is fine. Just curious Thank you for your time.
I believe in your button you need to add:
Application.Loadlevel(Argument);
Note that if you're using unity 5.3, Application.Loadlevel is deprecated and you should start using Scene$$anonymous$$anager.LoadScene.
Answer by Harryliu · Dec 23, 2015 at 04:27 PM
add this code to a new script and add it to an empty gameobject(or any other game objects). then go to the button, go to the button component, click the " + " sign, drag in the gameobject with the script, click on "No functions", select the name of the script and then select the name of the function, which is Click().
function Click ()
{
Application.LoadLevel("the name of your scene that you want to go to");
}
before you put in the name of your scene, go to the scene the button will supposedly take you to, go to File > Build Settings and click Add Open Scenes. you should see the scene appear in "Scenes in Build".
if you do it right, when you click on the button it should take you to the scene.
Answer by sandeepsmartest · Dec 23, 2015 at 07:29 AM
Below snippet may help you to load new scene on button click.As @LazyElephant said , if you are using unity 5.3 use scene manger (Check this). Hope this may help you. Nsks
if( GUI.Button(new Rect(Screen.width/2,Screen.height/2,100,100),"Next Scene"))
{
Application.LoadLevel("Next Scene");//copy paste your scene name here.
//Note: your new scene must be added in the buildsettings
}
Your answer
Follow this Question
Related Questions
make a loading screen 1 Answer
Game Optimization, Scene changing 1 Answer
screenviewcoord[1] < 0 || screenviewcoord[3] < 0 5 Answers
UnloadSceneAsync() does not seem to work with additive scenes. 1 Answer
How to prevent Unity3D making unnecessary changes after saving scene with no actual changes 0 Answers