The Escape Button is a Feature

DorianBurton6
1 min readOct 4, 2023

--

Most may not know this, but some of the luxuries we come to expect in gaming are not provided out of the box. Developers must figure out methods for the players to exit the game, access and change options in the settings and various menus, and even the menus themselves. All these things have to be created through code to operate how the players expect them to.

if(Input.GetKeyDown(KeyCode.Escape))
{
Application.Quit();
}

Such a simple line of code (for Unity), yet something that could be easily overlooked. But without this line, the only way to exit out would be task manager, Alt +F4, or hopefully it launched windowed. Most players just innately know that escape is the universal quit button, but it does not come prepackaged and must be made by us, the developers.

With this line in our Game Manager script, our player can quit the game at any time using the escape key. The ability to quit the game via key press is definitely a feature. Unity does not do it for us, therefore we must create the feature ourselves; otherwise our players will actually be stuck with our game.

--

--