How to Setup a WebGL Build for Your Game in Unity

Objective: To get your game setup for a WebGL build in Unity!

Now that we have previously walked through getting your game built for Windows/Mac, it is time to take the next step and share it with the World! Maybe you might want your friends, family or work colleagues to give it a go in order to provide some valuable feedback to you to help polish the final product? or, it is that damn good that you just want people to play it as soon as possible! Either way, let’s get your Unity game on the web.

Build Settings

Firstly, similar to building on PC/Mac let’s head over to the Build Settings menu and this time we are going to choose the WebGL platform.

Now depending on how you have built your game, you may run into an incompatibility error with Color Space rendering. E.g. I had previously changed this to Linear from Gamma for my Post Processing effects.

To get this uploaded we need to resolve this error, by going to Player Settings → Player → WebGL Settings tab → Other Settings → Rendering → Color Space → Gamma.

Now that we have completed this step it is time to ‘Switch Platform’. This may take a few minutes to complete so feel free to grab a delicious cup of coffee at this stage, I know I am.

We can now press the ‘Build’ button and similarly with the PC/Mac build it will ask you to find a folder you wish to save this in. It is best to place this into a new folder to prevent this Visual Studio error code from popping up:

Once this has finished, you should be good to open your index.html file and start playing!

--

--

--

Passionate Unity Game Developer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Scan GCP Storage Files for Viruses in C/C++

Hacking with Inspect element 😁

Beating the Bee

How to create custom post type in WordPress?

Custom post type created.

How to Save a Binary File to AWS

Use Pics.io’s Analytics & Reporting to Control Your Team Workflow

SQL | All you need to know as a beginner

Technology Trends in Fintech App Development

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Chris Hilton

Chris Hilton

Passionate Unity Game Developer

More from Medium

How to Make the Camera Shake Using Impulse Listener Extensions in Cinemachines Virtual Cameras

Learning Unity — The Singleton Design Pattern

Damage VFX Using Animated Sprites In Unity

How to make a Mario Kart game with Unity