Publish a Unity game on the web

Introduction

Here some tips to publish a game Unity on the web.

First, you should generate the application at a web format in Unity. Then, you can publish it. It is quite easy to publish a "light" project. Here the process, and I will describe at the end the issues with heavy project.

All the presented solutions work depending on the size of the web application (generally under 100M) .


Generate the app at a web format

1. Go to “Build your project” in “File” in Unity

2. Select WebGL, click on "Switch" if necessary and build your project/app by clicking on "Build" (the necessary scenes are selected on the top of the window).

It will generate a HTML folder, with the app at a web format. You cannot run it directly locally, you need a local web server (as EasyPhP or Xamp).

Publish your application on a web site

Then, three "easy" way for your unity game or app to be playable on the web:

  1. You import the generated files in any web hosting service provider, as to publish a web page from scratch.
  2. You host it on Github, by uploading the generated files on your github page. See https://medium.com/@aboutin/host-unity-games-on-github-pages-for-free-2ed6b4d9c324
  3. You can use Simmer.io. I am not sure if it is GDPR compliant (data protection in European Union) but here the information: https://simmer.io/gdpr. Publish you game in 5 min on the website. You will get html code to include your game in your webpage. You can update in the time your game by re-loading the files.


Back to the size problem

Git has a limit per file, around 100M. If your executable file for your game is heavier, you cannot use this option.

Most of the free web hosting service providers have a limit as well. Maybe you will have to pay.

Simmer.io does not have limit, and can be integrated very easily to any website with three lines of code. However, the GDPR compliance is not guaranteed.