Building Time — Build Your Game for Browsers
Objective: Build your game for WebGL
WebGL is a graphic library that allows the rendering of 3D content in an HTML page. It is possible to build a Unity project and make it playable on browsers, through a WebGL build.
In the Build Settings window select WebGL as platform (you should have chosen this option wile installing Unity Editor). Some options are available, for example you can select Development Build for some debugging.
The build button is not yet available: you first have to switch platform!
You can also see a warning concerning the colour space: you have to switch back to linear if the current is gamma.
Once switched to WebGL platform, everything is recompiled and the build button is accessible again. You can now build.
The output is playable through the index.html file, but if you try to open it that’s the result:
This is because you’re going to need a web server to run your WebGL. You can either start a web server or use the Build and Run option to let Unity do it ;) .