Loadlevel and buttons...

I’ve made a menu system that uses “Application.Loadlevel();” in order to load my scenes. When I go to build and play my game, the button I have set up to load the “Credits” works fine but the button that starts the first level doesn’t work at all. What am I missing? Does the way the level is named important? What if you renamed a level after you add it to the “Scenes to build” window, will it still work properly?

My Code:

var mySkin : GUISkin;



function OnGUI () {

	GUI.skin = mySkin;

	

	GUI.Box(Rect(0, 0, Screen.width, Screen.height), "");

	if (GUI.Button (Rect (180,400,300,250), "Start")) {

		Application.Loadlevel("Level1");

	}

	if (GUI.Button (Rect (520,400,300,250), "Quit")) {

		Application.LoadLevel("Credits");

	}

}

Your spelling is incorrect.

You wrote "Application.Loadlevel" , but it should be "Application.LoadLevel"

Edit: Look at the L in Level(Application.LoadLevel) it is lower case and should be upper case! :)

Doesn’t look like there is anything wrong with your code. Have you checked your Build Settings:

File => Build Settings…

and made sure that all your scenes are loaded into the ‘Scenes to Build’ window? Have you double checked your spelling, because as I’m sure you know passing strings inside of functions is explicitly case sensitive?