How to Build a Unity Game for the Web as WebGL

Building a Unity3D game for the web is simple! Once you build a game as WebGL, you can play it directly in your web browser.

In this article I'll also show you how to upload it to the web with ease.

A Fractal Example

For this example I'll use a 3D fractal from a Catlike Coding tutorial. You can download the unitypackage file from that tutorial and import it into Unity if you want to follow along.
First, open up the scene file and click "Play" to make sure the asset is correctly running.

Build your game for the web

File -> Build Settings

Select the WebGL platform and add any scenes needed for the game. Build & Run.

Optionally you can click the "Player Settings" button if you want to change options like the width & height of your Unity export. For this example I'll leave those settings alone.