Version: 2019.1 (switch to 2018.3 or 2017.4)
Cross-Platform Considerations
Troubleshooting
Other Versions

Publishing Builds

At any time while you are creating your game, you might want to see how it looks when you build and run it outside of the editor as a standalone. This section will explain how to access the Build Settings and how to create different builds of your games.

File > Build Settings… is the menu item to access the Build Settings window. It pops up an editable list of the scenes that will be included when you build your game.

The Build Settings window
The Build Settings window

The first time you view this window in a project, it will appear blank. If you build your game while this list is blank, only the currently open sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
will be included in the build. If you want to quickly build a test player with only one scene file, just build a player with a blank scene list.

It is easy to add scene files to the list for multi-scene builds. There are two ways to add them. The first way is to click the Add Open Scenes button. You will see the currently open scenes appear in the list. The second way to add scene files is to drag them from the Project ViewA view that shows the contents of your Assets folder (Project tab) More info
See in Glossary
to the list.

At this point, notice that each of your scenes has a different index value. Scene 0 is the first scene that will be loaded when you build the game. When you want to load a new scene, use SceneManager.LoadScene inside your scriptsA piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. More info
See in Glossary
.

If you’ve added more than one scene file and want to rearrange them, simply click and drag the scenes on the list above or below others until you have them in the desired order.

If you want to remove a scene from the list, click to highlight the scene and press Command-Delete. The scene will disappear from the list and will not be included in the build.

When you are ready to publish your build, select a Platform and make sure that the Unity logo is next to the platform; if its not then click in the Switch Platform button to let Unity know which platform you want to build for. Finally press the BuildThe process of compiling your Project into a format that is ready to run on a specific platform or platforms. More info
See in Glossary
button. You will be able to select a name and location for the game using a standard Save dialog. When you click Save, Unity builds your game pronto. It’s that simple. If you are unsure where to save your built game to, consider saving it into the projects root folder. You cannot save the build into the AssetsAny media or data that can be used in your game or Project. An asset may come from a file created outside of Unity, such as a 3D model, an audio file or an image. You can also create some asset types in Unity, such as an Animator Controller, an Audio Mixer or a Render Texture. More info
See in Glossary
folder.

Enabling the Development BuildA development build includes debug symbols and enables the Profiler. More info
See in Glossary
checkbox on a player will enable ProfilerA window that helps you to optimize your game. It shows how much time is spent in the various areas of your game. For example, it can report the percentage of time spent rendering, animating or in your game logic. More info
See in Glossary
functionality and also make the Autoconnect Profiler and Script Debugging options available.

Further information about the Build Settings window can be found on the Build Settings page.

Building standalone players

With Unity you can build standalone applications for Windows, Mac and Linux. It’s simply a matter of choosing the build target in the build settings dialog, and hitting the ‘Build’ button. When building standalone players, the resulting files will vary depending on the build target. For the Windows build target, an executable file (.exe) will be built, along with a Data folder which contains all the resources for your application. For the Mac build target, an app bundle will be built which contains the file needed to run the application as well as the resources.

Distributing your standalone on Mac is just to provide the app bundle (everything is packed in there). On Windows you need to provide both the .exe file and the Data folder for others to run it. Think of it like this: Other people must have the same files on their computer, as the resulting files that Unity builds for you, in order to run your game.

Inside the build process

The building process will place a blank copy of the built game application wherever you specify. Then it will work through the scene list in the build settings, open them in the editor one at a time, optimize them, and integrate them into the application package. It will also calculate all the assets that are required by the included scenes and store that data in a separate file within the application package.

  • Any GameObjectThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
    See in Glossary
    in a scene that is tagged with ‘EditorOnly’ will not be included in the published build. This is useful for debugging scripts that don’t need to be included in the final game.

  • When a new level loads, all the objects in the previous level are destroyed. To prevent this, use DontDestroyOnLoad() on any objects you don’t want destroyed. This is most commonly used for keeping music playing while loading a level, or for game controllerA device to control objects and characters in a game.
    See in Glossary
    scripts which keep game state and progress.

  • Use SceneManager.sceneLoaded to define the message sent to all active GameObjects after the loading of a new level is finished.

  • For more information on creating a game with multiple Scenes, see our Tutorials.

Preloading

Published builds automatically preload all assets in a scene when the scene loads. The exception to this rule is scene 0. This is because the first scene is usually a splashscreen, which you want to display as quickly as possible.

To make sure all your content is preloaded, you can create an empty scene which calls Application.LoadLevel(1). In the build settings make this empty scene’s index 0. All subsequent levels will be preloaded.

You’re ready to build games

By now, you have learned how to use Unity’s interface, how to use assets, how to create scenes, and how to publish your builds. There is nothing stopping you from creating the game of your dreams. You’ll certainly learn much more along the way, and we’re here to help.

To learn more about constructing game levels, see the section on Creating Scenes.

To learn more about Scripting, see the Scripting Section.

To learn more about creating Art and importing assets, see Assets Workflow of the manual.

To interact with the community of Unity users and developers, visit the Unity Forums. You can ask questions, share projects, build a team, anything you want to do. Definitely visit the forums at least once, to showcase the games you make and find support from other developers.

Did you find this page useful? Please give it a rating:

Cross-Platform Considerations
Troubleshooting