2D Shooter: How to Escape the Game
Aug 7, 2021
Objective: Add a way to quit the application when the escape key is pressed.
This is quite simple. First, open up the game manager script and write an if statement for the escape key input. Then write Application.Quit();
Now for this to work, the game needs to be in a build, since Unity ignores quit commands otherwise. Other than that, you’re done and you’re free to build your game in fullscreen mode without getting stuck!