Documentation

​
​

Development

User Acquisition

Monetization

Industry

Multiplayer Services SDK

All Services

Multiplayer Services SDK

Multiplayer
​
​
Multiplayer Services SDK
  • Overview
  • Get started
  • Use multiplayer sessions
    • Integrate Multiplayer sessions
      • Initialize UGS and authenticate the player
      • Create a session
      • Create sessions in the Editor
      • Find and join a session
      • Matchmaking
      • Migrate session host
      • Leave a session
      • Get a list of joined sessions
      • Delete a session
      • Session configuration options
    • Game server hosting support
  • Manage sessions
  • Connect players through a relay
  • Networking
  • Matchmaking
  • Monitor and debug sessions
  • Tutorials
  • Reference
  1. Multiplayer Services SDK

Create sessions in the Editor

Create a session in the Unity Editor using ScriptableObjects.
Read time 2 minutes
Last updated a month ago

You can create and manage sessions using ScriptableObjects in the Unity Editor. There are two ScriptableObjects related to multiplayer sessions:
  • MultiplayerSession
    : Stores sessions and makes lifecycles events available within the Editor.
  • SessionConnector
    : Populates the
    MultiplayerSession
    ScriptableObject using the existing operations such as Create and Join.
Note
This functionality is available in the Multiplayer Services package version 2.2.0 and newer.

Use sessions ScriptableObjects

Follow these steps to use ScriptableObjects in your multiplayer project:
  1. Add a
    MultiplayerSession
    and
    SessionConnector
    ScriptableObject
    .
  2. Connect the
    MutliplayerSession
    ScriptableObject
    to the
    SessionConnector
    ScriptableObject.
  3. Configure the ScriptableObjects to match the needs of your project.
  4. (Optional) Configure
    SessionConnectorBehavior
    component

Add ScriptableObjects to your scene

To add multiplayer ScriptableObjects to your project, open the Project window and right-click in the folder your want to create the assets in. Then navigate to Create > Services > Multiplayer. Select Multiplayer Session and then repeat the process and select Session Connector along with your preferred connection type to create both.

Connect the ScriptableObjects

A
SessionConnector
ScriptableObject requires a 'MultiplayerSession' ScriptableObject to work.
Add a
MultiplayerSession
ScriptableObject to a 'SessionConnector' ScriptableObject in the Multiplayer Session field of the
SessionConnector
ScriptableObject in the Inspector window.

Configure 'SessionConnector' ScriptableObject

SessionConnector
supports the following connection types:
  • Create
  • CreateOrJoin
  • Join
From the Inspector window, you can also configure the following settings:
  • The maximum number of players (default is four).
  • The session name.
  • If the session is password protected, private, or locked.
  • Network options such as IP, port, listen IP.
  • Network type: direct, Relay, or none.
  • Session operation events.
  • Session lifecycle events.

CreateOrJoin

The
CreateOrJoin
connection type creates a session when the first user triggers the operation and adds the user to the session. When additional users arrive, they're added to already created session.
This setting is recommended during experimentation and testing because all users are added to the same session.

Create

The
Create
connection type creates a new session with a unique ID.
Note
The
SessionConnector
ScriptableObject retains its settings configuration when exiting Play mode.

Join

The
Join
connection type connects players to a specific session by using a session code or a session ID.

Configure SessionConnectorBehavior

You can optionally use a
SessionConnectorBehaviour
MonoBehaviour to manage session creation and sign-in in the Inspector window instead of in code. Assign a
SessionConnector
ScriptableObject. The MonoBehaviour determines whether to run the
SessionConnector
on sign in or only programatically. The
SessionConnector
determines the connection type (
Create
,
Join
, or
CreateOrJoin
) while
MultiplayerSession
subscribes to all
ISession
events.
The optional setting Execute On Sign In controls timing. When enabled, the behavior subscribes to
AuthenticationService.SignedIn
during
OnServicesInitialized()
so the session operation fires automatically the moment the player authenticates. When disabled, you have to call
Execute()
manually, for example from a Join Game button.

Additional settings

You can enable verbose logging within the Project Settings window. Navigate to Project settings > Services > Multiplayer then select the box for Verbose Logging.

Copyright © 2026 Unity Technologies
LegalPrivacy PolicyCookiesDocumentation Terms of UseDo Not Sell or Share My Personal InformationYour Privacy Choices (Cookie Settings)

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S and elsewhere (more info here). Other names or brands are trademarks of their respective owners.

Some pages are machine-translated for convenience, and may contain inaccuracies. In the event of conflicting information, the English version is authoritative.

  • On this page
    • Use sessions ScriptableObjects

      • Add ScriptableObjects to your scene

      • Connect the ScriptableObjects

      • Configure 'SessionConnector' ScriptableObject

        • CreateOrJoin

        • Create

        • Join

      • Configure SessionConnectorBehavior

      • Additional settings


Report a problem with this page