How to create a Quit/Exit button in Menu Scene

Hello, i have this menu scene and i want to have the command, when i click on the Quit button the scene closes.

If you are creating a button, something like this would work:

   void OnGUI(){
    if (GUI.Button (new Rect (0, 0, Screen.width * .6f, Screen.height * .12f), "Quit", random1)) {
    	Application.Quit ();
  		}
    }

Hey there,

Brackeys tutorial on the new UI in 4.6 is great, it helped me out to build my menu… :slight_smile:

Here’s the link to making your buttons do things,


And his video before, on setting up the UI if you need that too…