How to Build and Run a Unity Game Project

You may be excited to release your game into the wild, but make sure you consider the finer build settings that Unity provides.
Unity is a powerful engine that you can use to develop games, manage scenes, create sprites, and more. Once you have finished creating your game in Unity, you may want to build and run the application.
This is an important step that allows you to choose certain settings for your game. They include what platform the game is for, what icon you will use, the resolution, and whether the player can resize the window.
Once you have chosen these settings, Unity can build and package your application, which you can then distribute.
How to Change the Build Settings of a Unity Project
Assuming that you already have a game ready to publish, you can start making changes to the Build Settings. If you do not have a Unity game, you can get started with Unity for Game Development.
How to Specify the Platform for Your Game
Platform options include a Standalone PC game, PS4, iOS, PS5, Xbox One, Android, WebGL, and more.
Platform | Description |
---|---|
PC, Mac & Linux Standalone | This includes a standalone PC game that you can run on Windows, Mac OS, or Linux. The output folder will include an executable file that you can run. |
iOS | This allows you to run your game on Apple mobile products. When you build your game, Unity will generate an Xcode project, which you will need to bundle your game to send to the Apple store. You may also want to use an iOS Simulator to test your iPhone and iPad game. |
Android | This allows you to run your game on Android phones. You can read more in Unity’s documentation about building apps for Android. |
WebGL | This prepares your project so that you can host it on the web. The output folder consists of an index.html file, and resource files for the logo and loading bar. It also contains a folder for additional necessary resources like framework, data, and code files. |
Console Specific (for example, Xbox, PS4, PS5) | This allows you to run your game on specific consoles. |
You can specify your desired platform under the Build Settings tab.
- With your Unity project open, click on the File tab at the top of the Unity window. Select Build Settings.
- A new window will open where you can specify the Platform of your game.
How to Select the Scenes That You Want to Build
You can also use the Build Settings window to specify the scenes you want to publish.
- In the Scenes In Build panel, select the scenes that you would like to include in your published game.
- If your scenes are not visible, you can click on the Add Open Scenes button. Make sure that your scenes are open in Unity.
How to Change the Advanced Build Settings
You can also change other project settings, such as your icon, splash screen, or resolution.
- At the bottom-left of the Build Settings window, click on Player Settings.
- This will open another window that will allow you to specify other settings like audio, resolution, icons, or graphics. For example, in the Audio tab, you can specify the Default Speaker Mode of your game. Options for this include Stereo, Mono, or Surround.
- Open the Player tab. Specify the company name, product name, and game version.
- Specify a default icon for your game. You can also expand the Icon section, and specify an icon for different screen sizes.
- Expand the Resolution and Presentation section, and specify the resolution for your game.
- Expand the Splash Image section. This is where you can configure a custom splash screen, which is the screen that you present to the user when they first open your game.
- You can find other settings such as compression settings or stack trace logging if you expand the Other section.
How to Build and Run the Unity Project
You can Build and Run the project from the Build Settings tab.
- Click on Build and Run, and choose a folder location where you would like to store the game files.
- Once the process is complete, the game will run automatically. Unity will present the splash screen to you before starting the game.
- Navigate to the folder where you have stored your game files to view the project structure. This will be different depending on the platform for the game. For example, a PC standalone game will include an executable file.
Developing Games With Unity
You can use the Build Settings to specify any advanced settings for the published version of a Unity game. This includes your game’s icon, resolution, audio, splash screen, or platform settings.
You can then start building your Unity game for distribution and publishing. Unity will output a folder for your completed game which you can run on a specific platform.
It is important that your game’s code structure is clean and organized. You can learn more about Modular Programming to ensure that you separate your code logically.