Exporting for Web
To export your experience as a Web app, follow the procedure corresponding to your version of Unity.
Settings for Unity 6
From the Unity editor's menu bar, go to Zoe > Build Target Window.
Click on
Switch build target to WebGL. Wait a moment for the process to complete.
Additional Settings
A few settings need to be activated for the Web export to work properly with Unity 6.
Make sure that
Enable Desktop Camera Controlis checked in the inspector of your interactive camera(s) (Interaction Rig).From the Build Profiles window, click on
Player Settings.Select
Playerfrom the sidebar.Expand
Other Settings.Uncheck
Auto Graphics API.The Graphics API option is set to
WebGL 2; change it toWebGPU (Experimental)by adding it with the+button. You can then removeWebGL 2from the list by selecting it and clicking on the-button.
Still from the
Playerwindow, expandPublishing Settings.Change
Compression Formatto Gzip.Uncheck
Data Caching.Check
Enable C/C++ Multithreading.
Select
XR Plug-in Managementfrom the sidebar.From the Web tab (symbolized by a world globe), uncheck
Initialize XR on Startup.
Settings for Unity 2023 and prior
Make sure that
Enable Desktop Camerais checked in the inspector of your interactive camera(s) (Interaction Rig).Go to File > Build Settings.
Select
WebGLin the sidebar.If you see an
Install with Unity Hubbutton, click on it. Unity will then install the necessary WebGL modules. You may need to close and reopen Unity after the process.With WebGL selected, click on
Switch Platformat the bottom of the Build Settings window.
Exporting for Web
In File > Build Profiles (or Build Settings), make sure all necessary scene(s) of your experience are selected in the Scene List.
Hit
Build.Name your build, select a folder for it to be exported to, then click
Save.
It will take a few minutes for your build to export. Once done, your exported files will automatically open in a new window.
Playing your Experience
Once you've exported a build for web, it's time to play it.
Select your build and compress it as a .zip file (Windows: right-click on folder, Compress to... > ZIP File / macOS: right-click on folder, Compress "[Build name]").
Go to play.unity.com.
Log into your Unity account, then click on the Upload icon on the right side of the menu bar.
Select your build's ZIP file or simply drag and drop it into the Upload section.
Fill in the Title and Description fields, then hit
Save.
Hit the
Playbutton to launch your experience!
Last updated