How to make ESC button quit?

Hi

At the moment when you play my game CTRL+Q quits the game how do I make ESC quit the game?

I have seen posts which tell you scripts that can do this but where do you put the script?

Thanks,
Michaela (newbie to unity)

Use this!

function Update ()
{
	if(Input.GetKeyDown(KeyCode.Escape) == true)
	{
		Application.Quit();
	}
}

I hope this help

function Update () {
if (Input.GetKey ("escape")) {
Application.Quit();
}
}

I also make video tutorials.
link text

Create a script called something like QuitOnEscape, and attach it to the camera. The script’s update method should look like this:

        function Update () {
		    if (Input.GetKey ("escape")) {
		    	Application.Quit();
	       	}
	    }

and for the C# fans

void Update () {
if (Input.GetKey (“escape”)) {
Application.Quit();
}
}