GUI not showing in game

Hi, when i create a new GUI script and click play nothing shows up on the screen but dark blue, also I use a Mac OSX and my script is
/* Example level loader */

function OnGUI () {
// Make a background box
GUI.Box (Rect (10,10,100,90), “Loader Menu”);

// Make the first button. If it is pressed, Application.Loadlevel (1) will be executed
if (GUI.Button (Rect (20,40,80,20), "Level 1")) {
	Application.LoadLevel (1);
}

// Make the second button.
if (GUI.Button (Rect (20,70,80,20), "Level 2")) {
	Application.LoadLevel (2);
}

}

1 Answer

1

Have you attached this script to anything? Assuming this OnGUI is in a monobehavior, it looks right and should execute fine, but you have to put it on a gameobject before it runs.