How to Host Unity Games on the Web
Today is the day! You finally have a version of your first game you’re ready to share with the world. But, how will the world receive your masterpiece? What exactly does it take to distribute a game? Through the magic of the Internet, of course!
There are a number of routes to distribute a game, from Steam to Itch.io and everything in between. Depending on which platforms you’re building to your range of choices will vary. Perhaps the simplest route is to build a WebGL release.
WebGL is an API for rendering graphics natively in your web browser without having to install any plugins. This makes the barriers to access for your potential audience evaporate. Anyone with an internet connection can click around in the fruits of your imagination without having to install a thing. There are several sites that will host your WebGL games for free. Many of them act as an open marketplace where you can gain followers and see other game developers do their thing. I recommend comparing the top search results and picking the one that suits you and your game best.
Whichever you decide, the first thing you need to do is build your game. Pull up your Build settings in Unity (In the File menu, or Ctrl+Shift+B).
If you select WebGL from the Platform menu, you might get a little warning down by the Build and Run button. There are compatibility issues with the Color Space in the Other Settings tab of the Project Settings window.
Switch to “Gamma” and watch the import slowly tick away. Maybe make some tea, or coffee.
Now, you should be all good to “Build and Run.” Choose a folder outside your project folder and let the process do it’s thing. Enjoy more load-time caffeine.
Once that’s done, you’ll have a tidy little folder with everything you’ve sweat and cried over for the past few weeks. You can test run the game by loading the index.html file in the game root folder.
You’ll want to follow the instructions for your chosen host to get your game out before the masses. Get that link and spread it far and wide, then lay back and soak in the adulation.
In the next article we’re going to discuss a feature that many take for granted: the escape key.