Version: Unity 6 (6000.0)
Language : English
Use the Multiplayer Center
Animation

New in Multiplayer

Find out what’s changed in multiplayer since the last release.

New Multiplayer features in Unity 6

Unity 6 simplifies multiplayer game development in a way that prepares you for future growth.

Multiplayer Center

Available as a core package in Unity 6, the new Multiplayer Center makes it easier to set up and develop multiplayer games. New prompts and workflows use parameters and requirements for your game to suggest relevant packages and services before generating dynamic templates you can use to start your project.

You never need to leave the Editor to set up a multiplayer game; and personalized interactive guidance, educational materials, and shortcuts make it easier to experiment and respond to feedback early and often.

Multiplayer Widgets

New Multiplayer Widgets make it easier to integrate Unity Gaming Services (UGS) into your multiplayer game. You can access the widgets as a standalone package, or from the Multiplayer Center.

Included services such as Multiplay, Relay, Lobby, Vivox make it easier to find compatible, relevant integrations. For example, integrating the Relay service into the Editor makes it easier to create sessions and connect users earlier in the development process.

Multiplayer Tools

The Multiplayer Tools package version 2.2.1 improves workflows for multiplayer game development in Unity, performance with Netcode for GameObjectsThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary
2.0, and adds support for Distributed Authority.

Multiplayer Play Mode

The Multiplayer Play Mode package offers workflows for reducing iteration cycles, validating implementation choices, and improving gameplay quality early across runtime processes:

  • Test functionality across separate processes without leaving the Unity Editor.
  • Simulate up to four players (the main Editor player plus three virtual players) simultaneously on the same development device with the same source assets on disk.
  • Create multiplayer development workflows that reduce the time it takes to build a project, run locally, and test the server-client relationship.

New Play Mode Scenarios integrate test cycles into production environments to help you deliver a first-playable experience with real players earlier. Play Mode Scenarios support desktop and dedicated server environments.

Dedicated Server package

The Dedicated Server package consolidates the dedicated game server workflow in the Editor to make it easier to deploy dedicated servers locally and to Multiplay hosting.

For example, you can switch a project between the server and client role without needing to create another project. To make switching a project easier, new Multiplayer roles let you distribute GameObjects and components across the client and server.

Multiplayer roles give you control over which multiplayer role (Client, Server) you use in each build target:

  • Content Selection: Provides UI(User Interface) Allows a user to interact with your application. Unity currently supports three UI systems. More info
    See in Glossary
    and API for selecting which content (GameObjects, Components) should be present/removed in the different multiplayer roles
  • Automatic Selection: Provides UI and API for selecting which component types should be automatically removed in the different multiplayer roles
  • Safety Checks: Activates warnings that help detect potential null reference exceptions caused by stripping objects for a multiplayer role

Distributed Authority (beta)

Create stable, less expensive client-hosted games when you use Distributed Authority (beta) mode in Netcode for GameObjects 2.0 (com.unity.netcode.gameobjects) with the new Multiplayer Services package.

Distributed Authority gives clients distributed ownership of authority over spawned NetcodeObjects during a game session. The netcode simulation workload is distributed across clients, while the network state is coordinated through a high-performance cloud backend which Unity provides.

Distributed Authority also supports host migration so the state authority between clients can be transferred when one disconnects without disrupting the continuity or stability of your game.

Netcode for GameObjects

Netcode for GameObjects version 2.0 now supports Distributed Authority and includes improvements to promote best practices in multiplayer game development.

For more information about basic Netcode for GameObjects features with practical examples and tutorials, see the Multiplayer Use Cases Bitesize Sample. Each sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
is designed to show how you can use individual APIs and systems, such as client-server communication, state synchronization, and other components of multiplayer games.

Netcode for Entities

Netcode for Entities version 1.3 includes several usability improvements, a new sample, and a demo game:

  • The new Experimental Netcode for Entities sample with Experimental Host Migration optimizes reliability for client-hosted games and supports continuity of gameplay for better player experiences.
  • A new demo game, Megacity Metro, shows Unity 6 makes setting up multiplayer services, networked vehicle implementation, configurable rule-based matches, and immersive player communications faster and easier.

Multiplayer Services package

The new Multiplayer Services package simplifies the work it takes to manage dependencies across multiplayer services. For example, you can:

  • Quickly add multiplayer elements that integrate Unity Gaming Services into your game. Set up Lobby, Relay, Distributed Authority, Matchmaker and Multiplay Hosting.
  • A new session system provides a simple shared cloud-side backing for a multiplayer game loop that groups players together and manages a shared session/player state.
  • Create and manage peer-to-peer (P2P), Dedicated Game Server, and Distributed Authority hosted online sessions. Players can join sessions through matchmaking, a Join Code, or by browsing a list of active sessions.

To make configuration easier, sessions now integrate directly with Netcode for GameObjects, Netcode for Entities, and the Unity Transport package.

Vivox communications and safety

The new Safe Text platform can screen and filter toxic content in multiplayer games in real-time. A new AI feature for Context Analysis uses contextual information from entire conversations to accurately identify toxic content which other filters miss.

New in previous releases

Netcode for GameObjects

Changes introduced in Unity 6 Preview

  • Added Distributed Authority mode in Netcode for GameObjects clients have distributed ownership of or authority over spawned Netcode objects during a game session. With Distributed Authority, the clients have the governed authority to spawn network objects which is announced to the cloud state service and conveys state updates to all connected clients. A highly optimized cloud state service maintains the overall state of a network session between clients.
  • Added a new RPC attribute that can perform the functions of both Server and Client RPCs, as well as enabling client-to-client RPCs.
  • Added many utility methods, which include NetworkManager.OnConnectionEvent, -ServerIsHost, -InstantiateAndSpawn, and more.

Changes introduced in 2023.2

  • Added the Refresh In-Scene PrefabAn asset type that allows you to store a GameObject complete with components and properties. The prefab acts as a template from which you can create new object instances in the scene. More info
    See in Glossary
    Instances
    option in the Network Object component context menu. Use this property to update the GlobalObjectIdHash value for prefab instances in the scene that existed before they had a NetworkObject component. This property affects all scenes included in the build list.
  • Added the NetworkManager methods SetPeerMTU and GetPeerMTU to give full control over Maximum Transmission Unit (MTU) sizes. Use this for custom protocols in Netcode for GameObjects.
  • Improved network prefab identification generation (for example, GlobalObjectIdHash) to fix issues where Unity assigned invalid values.
  • Improved the serialization API and codegen pipelines in the following ways:
    • Added the GenerateSerializationForTypeAttribute method that you can apply to any class or method to ensure the specific type is included in the codegen serialization process.
    • Added the GenerateSerializationForGenericParameterAttribute method that you can use to include generic type(s) wrapped by a NetworkVariable type in the codegen process.
    • Exposed additional NetworkVariableSerialization methods to improve custom NetworkVariable creation without any boxing cost. You can use the NetworkVariableBase.MarkNetworkBehaviourDirty method to mark NetworkVariables as dirty.
  • RPCs in generic NetworkBehaviour types can now serialize parameters of the class’s generic types.
  • Improved support for 32-bit ARMv7 in Netcode.
  • Added additional NetworkManager events OnServerStarted, OnServerStopped, OnClientStarted, and OnClientStopped to provide better notification of the NetworkManager initialization process.

Netcode for Entities

Changes introduced in Unity 6 Preview

  • Added support for GameObjects to render debug bounding boxes.
  • Added the NetCodeConfig ScriptableObject which contains most NetCode configuration variables that you can customize without needing to modify code.
  • You can now disable the automatic bootstrapping in the following ways:
    • Disable automatic bootstrapping in the ProjectSettings.
    • Add the new OverrideAutomaticNetcodeBootstrap MonoBehaviour to your first build scene.
  • Added AlwaysRelevantQuery that you can use to specify general rules for relevancy without specifying it ghost by ghost.
  • Added BatchScaleImportanceDelegate, a new version of the importance scaling function that works in batches. It is not required to set both the ScaleImportance and the BatchScaleImportance function pointers. If the BatchScaleImportance is set, it is the preferred.

Multiplayer Play Mode

Changes introduced in Unity 6 Preview

Updated Multiplayer Play Mode to version 1.0. Use it to test multiplayer functionality without leaving the Unity Editor. For more information, refer to the Multiplayer Play Mode documentation.

Dedicated Server

Changes introduced in Unity 6 Preview

Released the Dedicated Server package that you can use to switch a project between the server and client role without the need to create another project. For more information, refer to the Dedicated Server package documentation.

Changes introduced in 2023.2

Added the Dedicated Server Optimizations option in the player settingsSettings that let you set various player-specific options for the final game built by Unity. More info
See in Glossary
that, when enabled, strips all shadersA program that runs on the GPU. More info
See in Glossary
from server builds. Enable this option to considerably reduce the build time.

Changes introduced in 2023.1

Added new Dedicated Server Standalone player options to assembly definition exclude and include platform lists.

Tools

Changes introduced in Unity 6 Preview

Updated the Multiplayer Tools package to version 2.1.0, adding Network Scene Visualization as a new visual debugging tool. For more information, refer to the Multiplayer Tools documentation.

Changes introduced in 2023.1

Added Multiplayer Play Mode as an experimental feature. Multiplayer Play Mode is a workflow improvement feature from our multiplayer toolset that aims to deliver a user experience that is “single-player like”, but with a focus on the development cycle of multiplayer games.

Unity Transport

Changes introduced in 2023.2

  • Unity Transport 2.X is the now the default and recommended version of Unity Transport.
  • It is now possible to configure the maximum message size that the transport sends through a new maxMessageSize parameter in NetworkSettings.WithNetworkConfigParameters. This is useful for environments where network equipment mishandles larger packets (like some mobile networks or VPNs). The value excludes IP and UDP headers, but includes headers added by the transport itself (for example, reliability headers). The default value is 1400. Note that both client and server should use the same value.

Changes introduced in 2023.1

The Unity Transport Protocol (or UTP) is a lower-level networkingThe Unity system that enables multiplayer gaming across a computer network. More info
See in Glossary
infrastructure that handles the transport of data across the network and across connected platforms and devices. In the most recent release we are enabling Web and TCP connections to improve the reach of our netcode solutions (like Netcode for Gameobjects and Netcode for Entities).

Samples

Changes introduced in Unity 6 Preview

  • Added the Dedicated Game Server sample to demonstrate how Multiplayer Play Mode and the Dedicated Server work together with Netcode for GameObjects.
  • Added the Distributed Authority sample that integrates the Distributed Authority network model in Netcode for GameObjects.

Additional resources

Use the Multiplayer Center
Animation