x


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

more ▼

asked Apr 22 '11 at 12:46 PM

wesley gravatar image

wesley
48 24 38 46

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

Hello Wesley,

Please try this. I've tried works.

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

Regards

more ▼

answered Apr 22 '11 at 01:13 PM

Grcan SERBEST gravatar image

Grcan SERBEST
71 1 1 7

(comments are locked)
10|3000 characters needed characters left

It works, thanks.

I put it to the main camera object. Wonder if it's the right place.

more ▼

answered Nov 19 '12 at 08:56 PM

Dr Soul gravatar image

Dr Soul
1

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x70
x57
x36
x11

asked: Apr 22 '11 at 12:46 PM

Seen: 1282 times

Last Updated: Nov 19 '12 at 08:56 PM