While Unity's WebGL support for mobile is currently 'experimental', we've found it's possible to build great AR experiences with Unity and deploy to the web.

Unity's built-in WebGL template does not render the player window in fullscreen by default. The Zappar library provides an alternative template that shows a simple loading bar while the Unity content is loading, and fills the full browser window. You can use this template by navigating to the Resolution and Presentation section in the Player Settings menu and selecting the Zappar template.

For Unity 2019 and older versions, use the Zappar 2019 template. For Unity 2020 and above, use the Zappar template.

WebGL settings

When deploying to WebGL you'll want to run the publish command / upload the ZIP folder within the folder that's generated by Unity - it should contain an index.html file.

If you're using the ZapWorks CLI does not send a Content-Encoding header for Unity's gzip files, so it's best to set the Publishing settings > Compression Format setting to Disabled or by enabling the Publishing Settings > Decompression fallback.

Note you can also make use of menu option Zappar/Editor/Update Project Settings To Publish to make these specific changes around setting WebGL-Template and compression settings. Though you should always double check to confirm.

For a more detailed step-by-step on how to build and publish to WebGL, head over to our Publishing article.

zapcode branded_zapcode i