The Escape Button is a Feature

Simon Leen
Jun 13, 2021

--

Objective: Implement the escape key logic to exit the game.

As mentioned in an earlier post, if the game is in fullscreen, there needs to be an escape function created or else you can’t exit/close the game. To fix this issue, we will create the logic within the GameManager.

Inside the update method run an if statement to check if the escape key has been pressed using the Input.GetKeyDown function and if called, get the application to quit.

Close application when escape key is pressed

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