Scene not loading when pressing menu button

I have created a simple menu using a GUISkin. I added in the code to load a new scene when a menu button is pressed, but when I try it, nothing happens. Is there anything I missed in the process of creating a working menu?

Example code:

if(GUILayout.Button ("Credits")){
	yield new WaitForSeconds(0.35);
	Application.LoadLevel("Credits");
}

When you test your menu from Unity and try to press the button you will probably notice an error message: Level Credits couldn't be loaded because it is not added to the build settings. The code is fine and the solution straightforward. You just have to go into the Build Settings... option in the File menu. You will notice that the Credits scene you are trying to load is not there. You just have to drag it from your Project Panel in the Scenes to build section of the Build Settings window. Your menu should work now.

Also it is very important that your Main menu scene (or the Scene that you want your game to load when you start it) be the first one in the Build Settings. The order of the other scenes in the Build Settings is not important.

first of all the order of scenes is important when you want to load them with their index number and don't want to use their name. also if the problem would be about the build settings list, an error message would be shown in your game telling that you should add the scene to your list. i think you have another problem if you don't see any error(you did not say anything about it). try to print something above your Application.LoadLevel () function to see if the click even is triggered or not.

hi i haveing difrent problem then i use application.loadlevel in my script then i run my project i load main meniu scean and then it’s automaticly loading next lvl but i made GUI button to do that
my script looks like this were i added application.loadlevel

private void DisplayButton()
{
if(GUI.Button(new Rect(Screen.width/ 2 - 50,STAT_STARTING_POINT + (10 * LINE_HEIGHT),STAT_LABLE_WIDTH,LINE_HEIGHT),“Create”));
{
GameObject gs = GameObject.Find(“_ _gamesettings”);
GameSettings gsScript = gs.GetComponent();
gsScript.SaveCharacterData();
Application.LoadLevel(1);
}
}