How to Host Your Unity Games on the Web
Once your game is up and ready, you will want to share it with as many people as possible. The easiest way how you can let people all over the world experience your game is to host it on the Web. And the process of sharing it with Unity is so easy!
First, we will look at how you can build your game using WebGL, and same as in the previous article, you first have to open the ‘File’ > ‘Build Settings.’
Next, you need to switch the ‘Platform’ from ‘PC, Mac & Linux Standalone’ to the ‘WebGL.’ - if you are doing this for the first time, this might require an installation.
Once the module is finished downloading, you can go ahead and continue with the building process. Open up the ‘Build Settings’ once again, click on the ‘WebGL’ and click the ‘Switch platform’ button.
Once that is done, you can notice an error message is shown - This is due to our post-processing changes.
For this reason, we need to change the ‘Color Space’ inside of the ‘Player Settings’ from ‘Linear’ to ‘Gamma.’
With these changes in place, we need to make some adjustments to the post-processing effects to look more or less the same as the ‘Windows’ version.
- Here I have Cloned the previous Profile and renamed it to “… - Gamma.”
- I have also renamed the previous Profile and renamed it to “… - Linear.”
- I have switched the profile in the Volume to the new Gamma one, and I have tweaked the effects a little bit to match the new look.
Building the WebGL
Once the project is prepared for the build, open the ‘Build Settings’ again and click on the ‘Build’ button. Next, specify the folder where you want to have your build placed and click on the ‘Select Folder’ button.
Unity will now begin building your project.
Once the build is complete, you will have all the files needed to run your game on the web! You can now upload these files to your own web server, or alternatively, you can upload them to any web platform which offers hosting for your games; for example:
Let’s take a look at ‘Itch.io.’ You first need to register - Once registered, log in, and you can upload your game. Start by clicking on the ‘Create new project button’!
Here, insert all the information about your project and upload your project files.
Note, that your files need to be archived in order for your game to work!
Once uploaded, click on the ‘Save & View page’ - and your game is now uploaded & ready to play!
But that is it for now, thank you for reading and feel free to follow me for more articles - and as always, good luck and see you next time!