Unity: Building your game for the web

Currently, our project is setup to build for Windows. To change this we need to go to File > Build Settings. Select WebGL and then click ‘Switch Platform’.

When we switch to WebGL we get a warning relating to the color space used in the project. Back when we were implementing post processing we changed this from Gamma to Linear; for WebGL we need to change it back.

In the Build Settings window click on ‘Player Settings’. Under ‘Player’ expand ‘Other Settings’ then change Color Space to Gamma. This does mean we won’t get the HDR color grading that we previously implemented, but these settings can be changed to complement WebGL.

With that done, we can go back to our Build Settings window and click ‘Build’ Select a suitable location for the build and wait for Unity to do it’s thing.

Bear in mind you may need a local web server installed to test this on your own PC. Alternatively you can create an account at itch.io and upload it there.

Once the build is complete, you can open index.html in the build folder to run your game in your web browser! If you host this on the web, you can now easily share your work.

--

--

--

Software developer in the field of Unity and C#. Passionate about creating and always driven to develop.

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

Recommended from Medium

Enhancing Distributed Tracing with Business Context

SNXweave Weekly Recap

End to End Testing with Postman and Docker ( Part 2 )

Lambda Architecture for IoT

Is programming just about coding?

The Case for No Code Apps

Setting up Docker on Raspberry Pi

New Java 9 Release Date, Final JPMS EG Meeting, and Matryoshka Brains

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
Ian Plumpton

Ian Plumpton

Software developer in the field of Unity and C#. Passionate about creating and always driven to develop.

More from Medium

Publishing to the Google Play store

Magnetism in Unity Made Easy!

2.5D Platformer: Moving Platforms

Indy Pro ’22: Talent Training