Building Your Game / Compiling

When you’ve built something you’re proud of (or you’ve finished cloning our slightly dodgy Pong example for practice), it’s time to move your game from the editor and turn it into something that you can post on the Internet and force your friends and family to play. In order to do that, you’ll need to build a standalone application. The good news is that in Unity, this is very, very easy. There are, however, a few potential hiccoughs that you’ll want to be careful of.

For starters, know that you can only build an error-free project. To that end, make sure you have the console open as you build: there are some error conditions that the game will ignore in the editor, but will still abort an attempted build. This only dumps error messages to the console, with no visible results onscreen, which can be frustrating if you forget to check. Once you’ve got your game compiling error-free, though, you can select ‘Build Settings’ under the ‘File’ menu, or press Ctrl-Shift-B. This will bring up a simple dialog that allows you to build your game for several platforms.

The process from there is self explanatory: select your options, and hit ‘build;’ the game will prompt you for a directory to install to, and will place both the executable and data directory there. These two files can be zipped together and distributed (just make sure you aren’t charging for a game built in the Unity demo, as this violates the terms of ser- vice).