You can use the escape button to code a variety of logic such as pause menus, exiting full screen mode, or to cancel out an menu or selection. In this tutorial we’ll be covering using the escape button to close our application if not in full screen or out of full screen if full screened. This feature is most useful for games built out to PC, Mac, or Linux.

Start by opening a new project or existing project, create a new game object named Exit Manager and a script by the same name.

Antonio Delgado

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store