How to Host Unity Games on the Web

Simon Leen
2 min readJun 12, 2021

--

Objective: Set up a WebGL build, ready to host on the web.

In the previous post, we ran a standalone build of our game for PC. Now it’s time to swap the target platform and build a WebGL version, that can be hosted from any web server or a home pc, laptop, Mac etc that is running a web software package such as Apache. There is another option to use services like simmer.io.

To start, go to the File, Build Settings and switch the target platform from PC to WebGL.

Open build settings to change platform.

You will notice to swap from the current settings to WebGL, the color space settings have to be swapped from linear to gamma.

Warning for swapping platforms

To change this, open player settings, go to other settings and change the color space setting in the drop down.

Changing from linear to gamma in color space settings

Once you switch platform, you will now see the build options where the switch platform options were previously.

Build option available in WebGL build settings

Once the build has finished (this may take some time), you will get a folder pop up with the html file and asset folders for your game.

WebGL build folder

Now you are ready to upload to a web server/service or run locally using a web server application such as apache. We will show this in detail in a later post, once all the touch ups like a exit game feature and minor game bugs have been finished with.

In the next post we will add the exit button feature.

--

--

No responses yet