The Escape Button is a Feature

Ryan McCoach
Apr 24, 2021

There is nothing more frustrating when a game enters full screen and the only way to get out of it is by turning off your device. Avoid this frustration for your player by creating a Quit button.

This is a simple feature to add. Looking at the GameManger script (the GameManager controls the state of the game) we will want to check for the Escape key being pressed. When that happens we just need to tell Unity to quit using Application.Quit(). That is it! Just a reminder that you cannot test out this feature in the editor. This will only work in the build of the game.

--

--