Unity Dev Blog: How to Build and Test Your Unity Game
You can write scripts and crate game art all you want, but at the end of the day, you’ll need to compile and test your game.
Unity has unparalleled platform support. This means that you can develop the game once and deploy it on one of many different platforms.
In this article I will cover the steps for building your game to a stand alone, playable version. I am working on a MacBook, but these steps work just as well for Windows.
When you are ready to create your first build, select File and then Build Settings…
This will bring up the Build Settings window.
First, make sure all of the scenes you want to have in your game are listed in the Scenes in Build section. The scene with the index of zero will be the initial scene in the game when it plays. Here you can see that I have the Main Menu as the first scene to load and play.
Next, pick the platform you wish to build the stand alone executable file for. I am building for macOS so that i can run and test the game on my McBook.
Click on the Build (or Build and Run). Unity will ask you where it should save the executable file after it is compiled. If you chose to run the game also, it will start automatically once the code compiles successfully.
If all went well, you will also get a message stating that the build completed successfully.
If there are problems with the build, Unity will give you the specific errors and do its best to describe how they occurred…
(not my actual experience — my build worked the first time)
Once you game has started, you can play test it to your heart’s content. You can also send the executable to someone else to test.
And really, it is that simple. Unless something goes wrong of course.
Now. What’s next? Well, we need to get our game out to the public or at least to our testers. In tomorrow’s article I will show you how to setup your game so it will work online. Then I will show how to use a hosting site to upload the game to! I’ll use Space Shooter 2D as the example since it is ready to be play tested. I’ll share the link to the game and discuss a few future upgrades I plan to make.
See you there!