Building your game for the Web
You’ve built the mechanics, you’ve stomped the bugs, you’ve polished the features, you’ve tested it outside of Unity, and finally you’ve created a build of your game. So now what? Now, it’s time to publish your game. Luckily for us, Unity has simplified the steps.
Building for the Web
One of the easiest way to get your game on the Web is to use the WebGL platform. Although there are some limitations, this platform doesn’t require additional tools or plug-ins to play your game. In addition, WebGL games can be played in most browsers, so as long as the user has a browser that supports WebGL, they can play your game.
To get started, open the Build Settings by going to File -> Build Settings
If the default platform isn’t WebGL, you can select WebGL and click on Switch Platform at the lower right.
Resolving Color Incompatibilities
When switching to the WebGL platform, Unity will recompile files in your build. However, sometimes issues will appear and if this happens, you can change it in the Player Settings.
If you still have Build Settings window still up, you can click on Player Settings in the lower left corner of the window. In addition , you can access Player Settings by going to Edit -> Player Settings
Once the window pops up, you want to select the HTML5 logo (if not already selected), and click on Other Settings. Here, change the Color Space from Linear to Gamma and allow Unity to compile again. After Unity is done compiling again, you can close the Player Settings Window.
Now you can finally build your game for the WebGL platform.
Hosting Your Games
If you have your own personal server, you can upload it to your server and allow others to play.
However, if you don’t there are several sites on the Internet that can host it, including:
- Unity Play
In addition to these sites, some cloud services like Microsoft Azure and software development services like Github also allows you to host your game. However, do note that these sites can be more complicated to set up and host your game than sites listed above.