Objective: Build a Unity Project to a Windows executable.
To build your game in Unity, select the File menu > Build Settings. The Build Settings window will pop up.
- In the “Scenes in Build” section, make sure the scenes you want are listed in the order you desire.
- In the “Platform” section, make sure PC, Mac & Linux Standalone is selected.
- Click on the [ Player Settings…] button at the bottom left. The Project Settings window will pop up.
- In the section for “Settings for PC, Mac & Linux Standalone”, change Fullscreen Mode to “Windowed”
- Close the Project Settings window.
- In the Build Settings window, at the lower right, click on the button [ Build And Run ].
- A “Build Windows” file saving window will pop up for you to specify which folder to save the build. I suggest making a “Builds” folder with subfolders for each new version. But that’s up to you.
- Unity will start compiling and building the game’s executable files.
- If the build encounters any compiling errors, the error messages will appear in the Console panel.
A common build error for a Unity project like this that uses the Filebase plugin are ArgumentException, Assembly UnityEditor errors about the Filebase.dll file:
To fix this, exclude the Filebase.dll file from the build:
- In the Project panel, navigate to the Filebase.dll file. The file path is similar to this:
Assets/GameDevHQ/FileBase/Plugin/Filebase.dll
The “.dll” extension may not display in the Project panel.
Select the Filebase file. - The properties for this file should display in the Inspector panel. If not, right click the Filebase file and select “Select Dependencies”. Additional properties should show up in the Inspector panel including “Select platforms for plugin”
- In the Inspector panel, uncheck the checkbox next to “Any Platform”. The text “Exclude Platforms” will change the “Include Platforms” and the four (4) platforms listed below will have their checkboxes checked.
- Uncheck the checkboxes next to “Editor”, “Standalone”, “Android”, “WebGL”
- Save the scene.
- Go back to the “Build Settings” window from the File menu and build the game again. The build errors should be gone and the game will compile.
