Question by
AlfredvanRaal · Mar 30, 2017 at 09:05 PM ·
stoppingstop animations
How to close game?
I made my first executable file of the Ufo2D tutorial project. I am running the game, and it works!
Then is saw that i couldnt close the game. I tried escape and other function keys. So i had to go to task manager with ctrl alt del keys to close it.
There should be another more easy way ... Anyone knows how to do it?
Comment
Best Answer
Answer by avazutaev · Mar 30, 2017 at 09:52 PM
Try to add this into your Update function:
void Update() {
if (Input.GetKey("escape"))
Application.Quit();
}
Your answer
![](https://koobas.hobune.stream/wayback/20220612114324im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Rigidbody Stop when no key pressed 1 Answer
iTween StopByName 0 Answers
Failed to Build for WebGL 1 Answer
How to stop object rotation when FPSController collides with object? 0 Answers
How to fix this? C# 1 Answer