Building Out My Game

Austin Hall
4 min readOct 21, 2022

--

WebGL Demo

In this article we are going to discuss how to build out the game so we can test it outside of unity.

lets start by going to build settings in the file menu and selecting WebGL.

But Before we head into the player settings, we need to tell Unity to switch platforms. After you select the WebGL platform, select the button that says switch platforms. this will allow Unity to recompile and set up the project for a WebGL platform.

Now we can build for a WebGL. You may notice that our menu options have changed slightly.

You will also notice that you get a caution that reads, “In order to build a player, go ‘Player Settings’ to resolve the incompatibility between the Color Space and the current settings.”

Select Player settings, go to the other settings tab and change the color space from Linear to Gamma. Unity will then recompile with the new settings.

After Unity compiles you can close the player settings window. In the Build settings you will now see the option to build.

Select build. Create a new folder, I called mine WebGL Demo. Make sure that folder is the selected folder and push the button.

Unity will build out the game to that folder.

Once Unity has finished compiling, you can go to your folder. When you open it you will see the build folder, the Streaming Assets folder, the template data and the index html file.

If you had a web server, you could upload those four files onto the server. Then you could go to your web URL, and you could see your game load. However, uploading through FTP or onto a server is beyond the scope of this article.

Windows Platform build

For windows we will do things a little different.

First, in your build settings make sure you switch platforms to windows.

After Unity has compiled go back to the player settings. you will notice that we are now in the windows, Mac, Linux build settings tab.

In other settings, change the color space back to Linear.

Rember, we need the color space to be Linear to use True HDR in our post processing.

Next select the Resolution and Presentation drop down arrow.

Here we are looking at the Fullscreen Mode options. If you haven’t specifically created a way to exit your game, such as closing the game when pushing the escape button, you should select windowed.

Now you can close the player settings and select build.

I created a folder labeled Windows Playable Build and built the game inside that folder.

Once Unity has finished the buildout you can go into that folder and open your game.

--

--

No responses yet