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.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response