Journal 31 — How to Host Unity Games on the Web

Chris Nielsen
3 min readMay 18, 2021

--

In the previous Journal, we created two test builds, one for standalone PC, and one for WebGL. In this example, we will go into a bit more detail on some of the settings to confirm for a WebGL build, and a couple options for hosting your game on the Web to play.

Under the build settings, you can switch to the WebGL Platform, and select Player Settings.

Unity Build Settings

In the Project Settings for Player, you need to convert the Color Space from Linear to Gamma.

Unity Project Settings for Player

Alternatively, if you uncheck the “Auto Graphics API”, this removes WebGL 1.0 which is not compatible with Linear Color Space. So with this approach, the Color Space can be left as Linear.

Unity Project Settings for Player, Color Space

Also in the Project Settings under Player → Publishing Settings, the Compression Format may be incompatible with certain hosting sites.

Unity Project Settings for Player, Publishing Compression Format

Once you have fixed all your settings, you can select “Build”, and the process will complete shortly with a .html file and two folders. You will need to select all these files and send to a compressed zip folder.

Unity test build for WebGL complete

One option to upload your test build is play.unity.com. The site has a very simply interface. You can create a free account, and from the homepage, select the upload arrow to post a project.

Unity Play for hosting a WebGL game

From there, you can upload your build, and fill in a few details about the project. At play.unity.com, I was able to successfully post a project using the Gzip compression with no errors.

Unity Play, post a project
Unity Play, opens test build successfully

Another option to post your test build is itch.io. Create a free account and from your Feed or Developer Dashboard you can upload a game or create a new project.

itchi.io, host a WebGL game

In the project creation page, you can fill in details on your test build and add screenshots.

itchi.io, Create a Project, fill in details

Further down the page, you can upload the test build files, again in a zip format. At itch.io, I was able to successfully upload and play with compression disabled.

itchi. io, upload WebGL files and update screen embed options and viewport size

At the bottom of the creation page, you can set the game access to “Public”, but only after you have done an initial save.

itchi.io, save project and make visible to public

Once you have saved your project at itch.io, you can view the published page, and also edit some of the format, such as text, colors, and show your screenshots.

itchi.io published game website, options to edit theme

Thank you for your time!

--

--

Chris Nielsen
Chris Nielsen

Written by Chris Nielsen

An Engineering Manager consultant who is seeking additional skills using Unity 3D for game and application development.

No responses yet