Unity  

How to Create and Publish WebGL Builds in Unity

WebGL

Once your real-time project is ready in Unity, you need to create a build so it can be played and shared. A build is just a playable version of your game. You can build for many platforms, but the easiest one is WebGL, which lets people play your game right in a web browser using JavaScript and HTML5.

In this guide, you'll utilize Unity's WebGL Publisher package to quickly generate a WebGL build and post it to Unity Play, a platform where people can browse and play your game. You’ll also get a link to share or use in Unity Learn submissions.

1. Make Sure You Have the WebGL Publisher Package

To check and install it.

  1. Open your Unity project.
  2. Go to Window > Package Manager.
  3. In the dropdown at the top, choose Unity Registry.
    Project
  4. Search for WebGL Publisher or “Share WebGL Game.”
    Share Web GL game
  5. Click Install if it appears. If an Update option shows up, click that. If you see a checkmark, you already have the latest version.

2. Make Sure WebGL Support Is Installed

  1. After you install the package, the top menu will show "Publish > WebGL Project."
  2. Go to Publish > WebGL Project.
  3. If asked, sign in to your Unity account.
  4. Click Get started.
    Publish
  5. Unity will check if you have WebGL build support. If it says “WebGL Module Not Installed,” follow the link to install it via Unity Hub, then return to this step.
    WebGL Module

3. Build and Publish Your Project

If it’s your first WebGL build.

Build and Publish

In the Publish window, click Build and Publish.

If prompted, switch your platform to WebGL.

A folder named WebGL Builds will be created. Inside it, make a new empty folder with the name you want for your project and select it.

Folder

Unity Play will open in your browser with a new page for your game.

There, you can,

  • Name your game.
  • Add a description.
  • Upload a thumbnail image.
  • Tag any assets or tutorials used.
  • Click Save when done.

4. Share on Unity Learn

To submit your project to a Unity Learn challenge, copy the Unity Play URL and paste it in the “Add a link to your WebGL project” field on the challenge page.

Share on Unity Learn

5. Share on Other Platforms

You may also share your WebGL build on platforms like,

Or your own website (e.g., using Squarespace, Wix)

Your build will include an index.html file and other folders/files that must stay in the same structure. Before you move the build, make sure you move the whole folder or zip file.

6. Update an Existing WebGL Build

To update your game.

Go to Publish > WebGL Project.

WebGL Project

Choose from,

  • Publish (uses the current build files)
  • Create and Publish New Build (start a new build from scratch)

7. Customize Build Settings

If your project has multiple scenes or you want more control.

Open File > Build Settings (or press Ctrl+Shift+B).

Select WebGL and click Switch Platform.

Select WebGL

In Scenes in Build, you can,

  • Add open scenes
  • Check/uncheck scenes to include or exclude
  • Reorder scenes (Scene 0 loads first)
  • Once done, you can build from this window or go back to the WebGL Publisher.

Conclusion

Now you’ve learned how to create a WebGL build, upload it to Unity Play, and share it in different ways. Sharing your work is a great step toward growing as a creator, so go ahead and show the world what you’ve built.

All Image References: Unity Learn