Ending the game

Hey all I want to do is have the game end when I enter a trigger box.

This is what I have

function OnTriggerEnter () {

Application.Quit();

}

However it says this doesnt work in the editor or in a web version. So what should I do?

Can you use OnCollisionEnter?

function OnCollisionEnter ()
{
Application.Quit();
}

I do not know if this will work in a web version, though.

Dont touch me!

Consider: what would it even mean for a web applet to quit? Would the whole web browser close?

When a game ends, generally the player will be returned to the title screen, or to the main menu. Under Unity, this would usually be done by loading the "title screen" scene.