The Escape Button is a Feature

--

ES-CAH-PAY. I wonder what that means…

When someone presses the Escape button in-game, that is not something that happens by default. A developer behind the scenes programmed in that functionality.

OBJECTIVE: When pressing the Escape button, the application quits.

Application.Quit is a method within the Application class that shuts down the running application. The call is ignored in the editor.

It’s good practice to put it in the Game Manager script. The code is pretty simple too! All you have to do is below:

Now, if your game has been launched, the Player can press the Escape button and close the application.

--

--

Tristan Mendiola

A passionate and driven C# and Unity developer experienced in making 2D and 2.5D titles. Deeply invested in blending the culture of people with technology.