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.
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.
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
}