- Home /
exit app doesnt work
hey guys this little script doesnt work it doesnt close the app when i press escape in my game i know it doesnt work in the editor but i have made a build version so i think it hasto work but it wont
do you now whats wrong? function Update() {
if (Input.GetKeyDown(KeyCode.Escape)) {
Application.Quit();
}
}
i have attached the scrip on a empty game object in the sene but still nothing
Comment
Answer by Grcan SERBEST · Apr 22, 2011 at 01:13 PM
Hello Wesley,
Please try this. I've tried works.
function Update () {
if (Input.GetKeyDown(KeyCode.Escape)) {
Application.Quit();
}
}
Regards
Answer by Dr Soul · Nov 19, 2012 at 08:56 PM
It works, thanks.
I put it to the main camera object. Wonder if it's the right place.