If You Build It They Will come

How to Build and Test your Unity Game

Today we’re going to look at manually building and deploying our game in Unity. Yes, I said manually. I prefer to set up a Continuous Integration and Deployment pipeline that produces built project files for each platform I need to release my game on but the steps involved are far heavier than I need today and I will most likely cover them in a future article. Today we’re going to just do a basic manual build.

Our first step is to open our Build Settings window in Unity by selecting

File → Build Settings

from the menu at the top of the application.

You’ll notice that the Scenes In Build section may not have anything in it! If we build the project without any scenes in the build then we will see the Unity splash screen and then just a black screen. This is definitely not what we want, so we need to add scenes to our build settings. We can do this in one of two ways

  1. Click the Add Open Scenes button
  2. Drag our scenes from our project window into the Scenes In Build section of our Build Settings window.

We can, and should order the Scenes in such a way as they make sense if we load or open them by Build Index which is displayed on the right side of the window.

Next we will want to adjust some of our Player Settings by clicking the button in the lower left-hand side of the window.

This will open the Project Settings Window.Here we can adjust settings like if the game opens in windowed or full screen, what splash screen we display on boot of the game, what our game icon is, and much more. For my purposes today, I’m interested in changing some publish settings for my WebGL builds. I upload my demos and game to a site that requires some specific settings for 2020 unity built projects. Namely, I want to click on the WebGL build tab and scroll down to Publish Settings. Once expanded, I want to find the Compression Format and make sure to change it from the default of GZip to “disabled”.

While we’re here we need to make sure that the Company name, Product Name, and version number are set. These settings are used to compose the package identifier used in both standalone and mobile builds of the game.

Once we have our settings taken care of we can close this window and go back to our Build Settings window. Here we can choose the platform we want to build for from the list of available platforms (and click Switch Platform if we need to change from the currently selected platform) and then click the Build and Run button to tell unity to launch the build.

Unity will present us with a window asking us where to store the build of the game. I store mine in the Build folder of my projects root and I have my git ignore file set to ignore this folder when checking my code in.

Once Unity completes the build it will auto run the game for you to test it. You can also run the game manually later from the Builds folder.

Next Time!

That’s it! We can now manually build our game for distribution to a number of platforms for testing. Next time we’ll look at How to host our Unity games on the Web using a WebGL build. If you enjoyed this article, or want to come along with me as I progress on my journey, follow me at gamedevchris.medium.com.

Unity Game Developer, Software Engineer, Gamer, Musician, and Father. Christopher is a creative that enjoys a challenge and loves coding.