Skip to main content

Distributed authority and WebGL quickstart

Use this guide to learn how to create your first distributed authority Netcode for GameObjects WebGL project.

This guide is intended as an addition to the distributed authority general quickstart page, which provides more details about setting up Netcode for GameObjects to use distributed authority.

Beta feature

Distributed authority is still in beta. During the beta phase, using the distributed authority service provided by the Multiplayer Services package is free. When distributed authority is fully released, using the service will incur a cost.

Prerequisites

Before you begin, you need the following general requirements to use the distributed authority network topology:

  • An active Unity account with a valid license.
  • The Unity Hub.
  • A supported version of the Unity 6 Editor. Refer to the Netcode for GameObjects requirements.
    • When installing the Editor, make sure to include the _WebGL Build Support module.

You also need the following packages and minimum versions for a WebGL distributed authority session:

  • Netcode for GameObjects version 2.1.1+
  • Unity Transport version 2.3.0+
    • Note that you don't need to create a self-signed certificate to connect to a distributed authority session.
  • Multiplayer Services version 1.0.2+

Create and set up your project

Follow the instructions on the distributed authority general quickstart page.

Build and run with WebGL

  1. Navigate to File > Build Profiles to open the Build Profiles window. Select WebGL as your target platform.
  2. From the Build Profiles window, click Build and Run.
    • Unity launches a small web hosting app to provide the HTTP services required to launch the WebGL application in your browser.
  3. Once you have one instance of your WebGL project running, you can copy the URI from your browser and paste it into another window or tab, which creates and connects another player to the same session.