2D Shooter: How to Escape the Game

--

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!

--

--

Sabrina Windsor
Sabrina Windsor

Written by Sabrina Windsor

Currently learning to code with the help of GamedevHQ in order to someday my my game ideas come to life!

No responses yet