My journey becoming a Unity game developer: How to Build and Test your Unity Game on PC & The Escape Button Feature

Rhett Haynes
2 min readSep 24, 2022

--

Objective: Implemented the ESCAPE key to be used to quit the game application during runtime. Also, building the game out for PC to test out the Quit() Application method.

Escape key pressed to quit the game.

Just in case we need to shut down the game when in full-screen build mode for any reason, we will quit the application using the ESC key. Inside the GameManager script under the Update() function, we will check IF the Escape key is pressed down. If so, use the Application class to access the Quit() method.

Application.Quit() used when the Escape key is pressed down.

Now to build the game out we need to go to File->Build Settings. By default Windows, MAC, and Linux is selected for the game to be built to. Make sure Target Platform is selected to your OS Type which is Windows for me, and Architecture selection is Intel-64 bit if your computer is a 64-bit architecture. Click on Build if you want to build the game, then go to the file location where the game was saved. Or, select Build and Run to start the gameplay immediately after saving the game.

Build the game through the Build Settings.

If you want to start the game from the file’s location, double-click on the name of the game’s .exe extension filename.

Game started from the file’s location.

With game active, start a new game …

then press the ESC key to quit the game.

--

--

Rhett Haynes
Rhett Haynes

Written by Rhett Haynes

Learning to become a Unity game developer.

No responses yet