Journal 31 — How to Host Unity Games on the Web
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.
In the Project Settings for Player, you need to convert the Color Space from Linear to Gamma.
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.
Also in the Project Settings under Player → Publishing Settings, the Compression Format may be incompatible with certain hosting sites.
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.
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.
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.
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.
In the project creation page, you can fill in details on your test build and add screenshots.
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.
At the bottom of the creation page, you can set the game access to “Public”, but only after you have done an initial save.
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.
Thank you for your time!