Unity Multiplay Setup: Relay and Lobby in 14 Steps [2026]

Unity quietly closed a chapter on September 18, 2026: direct support for the original Multiplay Game Server Hosting service ended back on March 31, and the company has spent the months since folding matchmaking, session relay, and dedicated server hosting into a single unified toolkit called Unity Gaming Services (UGS). If you searched “unity multiplayer tutorial” this week, there’s a good chance you landed on a guide built around the old standalone Relay and Lobby packages, both of which Unity now marks as deprecated for anyone running Unity 6.x. This tutorial covers the current path instead: the unified Multiplayer Services SDK, the Authentication package that reached version 3.8.0 on September 15, 2026, and the fleet-based Multiplay Hosting model that replaced the retired Game Server Hosting product. By the end you’ll have a working lobby-to-relay matchmaking flow running in the Unity Editor, plus the groundwork for moving that same project onto dedicated Multiplay Hosting fleets.

Google · Preferred Sources

Don't miss new tech stories on Google

Add Tech Insider once in the Google app and our stories appear in your news suggestions.

Add Now

What Unity Gaming Services Actually Replaced in 2026

For years, Unity sold three separate multiplayer building blocks: Relay for peer-hosted sessions that dodge NAT and port-forwarding headaches, Lobby for pre-game matchmaking and party formation, and Unity Multiplay (branded Multiplay Game Server Hosting, often shortened to GSH) for teams that wanted dedicated servers running in Unity’s cloud rather than a player’s machine. Each shipped as its own Unity Package Manager entry, with its own SDK, its own changelog, and its own quirks.

That architecture is gone for new projects. Unity’s own documentation states plainly that direct support for the original Multiplay Game Server Hosting service ended on March 31, 2026, with the underlying infrastructure moving to what Unity calls Rocket Science. On the client side, the standalone com.unity.services.relay and com.unity.services.lobby packages are deprecated starting in Unity 6, and Unity is steering every new integration toward one combined package, com.unity.services.multiplayer, which bundles Relay, Lobby, and the Multiplay Hosting client assets under a single dependency.

None of this is cosmetic. If you’re targeting Unity 2022 LTS or later, using the old standalone SDKs means building on packages that no longer receive new features and that Unity’s own docs tell you to migrate away from. This guide builds everything on the unified SDK from the start, so you don’t have to redo the work in six months.

Prerequisites: Editor, Package, and Account Versions You Need

Before touching the Package Manager, get these pieces in place. Version mismatches are the single biggest source of wasted time in UGS integrations, so treat this list as non-negotiable rather than a suggestion.

  • Unity Editor: 2022.3 LTS or newer, or any Unity 6.x release (6000.0+). The unified Multiplayer Services SDK is the recommended path for 2022 LTS and later; earlier editors can still use the standalone Relay 1.0.2+ and Lobby 1.0.1+ packages, but those are legacy paths this guide does not cover.
  • com.unity.services.multiplayer: the unified package covering Relay, Lobby, and Multiplay Hosting client assets. Add it through the Package Manager rather than editing the manifest by hand on your first attempt.
  • com.unity.services.authentication: version 3.8.0 or newer (Unity’s package index lists 3.8.0 as stable as of September 15, 2026). Earlier 3.7.x builds work but lack the restricted-token and targeting features covered later in this guide.
  • com.unity.netcode.gameobjects: version 2.13.0 or newer, publicly available since July 6, 2026, for editor and API compatibility with current Unity releases.
  • A Unity Cloud organization: a free account at the Unity Cloud dashboard, with at least one organization created. You’ll link your local project to a Project ID inside this organization.
  • A code editor: Visual Studio 2022 or JetBrains Rider with C# support. Nothing UGS-specific here, but async/await fluency will save you time since every UGS call is asynchronous.
  • Basic Netcode for GameObjects familiarity: this tutorial assumes you know what a NetworkManager and a NetworkBehaviour are. If not, spend twenty minutes with Unity’s own Netcode quickstart first.
PackageMinimum Version for This GuideConfirmed Current as OfNotes
com.unity.services.multiplayerLatest via Package ManagerSept 2026Unified SDK, covers Relay, Lobby, Multiplay Hosting client assets
com.unity.services.authentication3.8.0Sept 15, 2026Adds restricted tokens, targeting component
com.unity.netcode.gameobjects2.13.0July 6, 2026Editor and API compatibility updates
Unity Editor2022.3 LTSOngoing LTSMinimum for unified SDK; Unity 6.x also supported
com.unity.services.relay (standalone, legacy)1.2.0Deprecated in Unity 6Only for pre-2022 LTS projects
com.unity.services.lobby (standalone, legacy)1.2.2Deprecated in Unity 6Only for pre-2022 LTS projects

Steps 1-3: Create and Link Your Unity Cloud Project

Every UGS service, from Relay to Multiplay Hosting, hangs off a single identifier called the Project ID. You create it once and every other service you enable reads from it.

  1. Step 1: Open Project Settings. In the Unity Editor, go to Edit > Project Settings > Services. This panel is your entry point for every cloud-linked feature, not just multiplayer.
  2. Step 2: Create or link a Project ID. If your project has never touched Unity Cloud, click “Create a Unity Project ID,” pick an organization from the dropdown, and confirm. If your studio already has a cloud project for this game, choose “Use an existing cloud project” instead and select it from the list.
  3. Step 3: Confirm the link in the dashboard. Head to the Unity Cloud web dashboard, open Projects, select your project, and check the Settings tab. The Project ID shown there must match what’s in your Editor’s Services panel. If it doesn’t, unlink and relink before going further, because every service call downstream depends on this ID resolving correctly.

One detail that trips people up: creating a Project ID does not automatically enable any individual service. Relay, Lobby, and Multiplay Hosting each need to be turned on separately, either from the dashboard’s service pages or from the Editor’s Services panel using the per-service toggle. Skipping this step is the number one reason developers get authentication errors that look like a coding bug but are actually just a service that was never switched on.

Steps 4-5: Install the Multiplayer Services SDK and Authentication Package

With the project linked, pull in the two packages that everything else in this tutorial depends on.

  1. Step 4: Install com.unity.services.multiplayer. Open Window > Package Manager, switch the source dropdown to “Unity Registry,” search for “Multiplayer,” and install the Multiplayer package. This single install pulls in Relay, Lobby, and Multiplay Hosting client bindings together, which is exactly why Unity built it: no more juggling three separate package versions that occasionally fall out of sync with each other.
  2. Step 5: Install com.unity.services.authentication. Search “Authentication” in the same Package Manager window and install it. Confirm you’re on 3.8.0 or later by checking the version number shown in the package details pane before you close the window.

If you’d rather pin exact versions in source control instead of trusting whatever the Package Manager resolves at install time, edit Packages/manifest.json directly:

{
  "dependencies": {
    "com.unity.services.multiplayer": "1.3.0",
    "com.unity.services.authentication": "3.8.0",
    "com.unity.netcode.gameobjects": "2.13.0",
    "com.unity.transport": "2.0.0"
  }
}

Save the file and switch back to the Editor. Unity will resolve the new manifest and re-import automatically. If the import stalls or throws a resolution error, check that your internet connection can reach the Unity Package Registry, since corporate proxies and strict firewalls are a common cause of silent package resolution failures.

Steps 6-7: Implement Anonymous Sign-In and Handle Token Errors

Every UGS call, whether it’s creating a Relay allocation or querying a Lobby, requires an authenticated session. For a tutorial project (and for plenty of shipped games that don’t need persistent player accounts), anonymous sign-in is the fastest path.

  1. Step 6: Initialize services and sign in. Call UnityServices.InitializeAsync() before anything else, then sign in anonymously. Do this as early as possible in your game’s lifecycle, ideally in an Awake or Start method on a persistent bootstrap object, so later scenes never race against an incomplete sign-in.
using System.Threading.Tasks;
using Unity.Services.Authentication;
using Unity.Services.Core;
using UnityEngine;

public class UgsBootstrap : MonoBehaviour
{
    async void Awake()
    {
        await UnityServices.InitializeAsync();
        AuthenticationService.Instance.SignedIn += () =>
            Debug.Log($"Signed in. PlayerID: {AuthenticationService.Instance.PlayerId}");

        await SignInAnonymouslyAsync();
    }

    async Task SignInAnonymouslyAsync()
    {
        try
        {
            await AuthenticationService.Instance.SignInAnonymouslyAsync();
        }
        catch (AuthenticationException ex)
        {
            Debug.LogException(ex);
        }
        catch (RequestFailedException ex)
        {
            Debug.LogException(ex);
        }
    }
}
  1. Step 7: Guard against re-entrant sign-in calls. Calling SignInAnonymouslyAsync while a sign-in is already in progress throws an AuthenticationException with the error code ClientInvalidUserState. Check AuthenticationService.Instance.IsSignedIn before calling sign-in again, and if you need to force a fresh anonymous identity during testing, call AuthenticationService.Instance.ClearSessionToken() while signed out first.

The most common failure at this stage is a “Token has expired” error that has nothing to do with your code. Unity Support’s own troubleshooting notes point to an incorrect system clock on the device as the usual culprit. Before you spend an hour debugging your auth flow, check that the machine’s date and time are synced to an internet time server.

Steps 8-9: Set Up Relay for Peer-to-Peer Hosting

Relay solves a specific problem: getting a player’s game session reachable by other players without requiring port forwarding, static IPs, or NAT traversal tricks on the host’s router. The host requests an allocation from Unity’s Relay servers, gets back a join code, and shares that code with other players, who use it to connect through the same relay.

  1. Step 8: Create a Relay allocation as the host. Call RelayService.Instance.CreateAllocationAsync with your expected max connection count, then request a join code tied to that allocation.
using Unity.Networking.Transport.Relay;
using Unity.Services.Relay;
using Unity.Services.Relay.Models;
using Unity.Netcode;
using Unity.Netcode.Transports.UTP;
using UnityEngine;

public async void StartHostWithRelay(int maxConnections)
{
    Allocation allocation = await RelayService.Instance.CreateAllocationAsync(maxConnections);
    string joinCode = await RelayService.Instance.GetJoinCodeAsync(allocation.AllocationId);

    var transport = NetworkManager.Singleton.GetComponent();
    transport.SetRelayServerData(new RelayServerData(allocation, "dtls"));

    NetworkManager.Singleton.StartHost();
    Debug.Log($"Host started. Share this join code: {joinCode}");
}

Note the call order. Set the Relay server data on the transport, then call StartHost(), and do it immediately after acquiring the allocation. Relay allocations time out if no host binds and no ping is received at least every ten seconds. If you fetch a join code, display a lobby screen for two minutes, and only then start the host, you’ll likely find the allocation already invalidated.

  1. Step 9: Join the allocation as a client. Clients use JoinAllocationAsync with the shared join code, then configure their own transport with the returned join allocation before starting the client connection.
using Unity.Services.Relay;
using Unity.Services.Relay.Models;
using Unity.Netcode;
using Unity.Netcode.Transports.UTP;

public async void JoinWithRelayCode(string joinCode)
{
    JoinAllocation joinAllocation = await RelayService.Instance.JoinAllocationAsync(joinCode);

    var transport = NetworkManager.Singleton.GetComponent();
    transport.SetRelayServerData(new RelayServerData(joinAllocation, "dtls"));

    NetworkManager.Singleton.StartClient();
}

A subtle mistake here: the host should never call JoinAllocationAsync on its own allocation. Treat the host and the client connection paths as two separate code branches, because trying to make the host both create and join the same allocation is one of the most frequently reported “join code not found” errors in Unity’s developer forums.

Steps 10-11: Build a Lobby to Matchmake Before Relay

Relay handles the connection, but it doesn’t handle discovery. Lobby fills that gap: players create or join a lobby by name or filter, see who else is waiting, and only once everyone’s ready does the host generate the Relay join code and pass it along as lobby metadata.

  1. Step 10: Create a lobby and store the Relay join code as lobby data. Once the host has a Relay join code from Step 8, attach it to the lobby so joining players can read it without a separate network call.
using System.Collections.Generic;
using Unity.Services.Lobbies;
using Unity.Services.Lobbies.Models;

public async void CreateLobbyWithRelayCode(string lobbyName, int maxPlayers, string relayJoinCode)
{
    var options = new CreateLobbyOptions
    {
        Data = new Dictionary
        {
            { "RelayJoinCode", new DataObject(DataObject.VisibilityOptions.Member, relayJoinCode) }
        }
    };

    Lobby lobby = await LobbyService.Instance.CreateLobbyAsync(lobbyName, maxPlayers, options);
    // Send periodic heartbeats or the lobby expires after ~30 seconds of inactivity
}
  1. Step 11: Query and join lobbies from the client side. Use QueryLobbiesAsync to list open lobbies, then JoinLobbyByIdAsync to join one and read back the RelayJoinCode field to feed into Step 9’s client join flow.

Watch your call frequency here. Lobby enforces rate limits, and hammering QueryLobbiesAsync on every frame from a lobby-browser UI will trip a 429 Too Many Requests response almost immediately. Poll on a timer, not a per-frame Update loop, and add exponential backoff around any Lobby call that can fail from rate limiting.

Step 12: Wire Relay, Lobby, and Netcode Together

With the individual pieces working, Step 12 connects them into a single flow: sign in, create or join a lobby, host allocates Relay and writes the join code into lobby data, other players read the code and connect through the transport, and Netcode for GameObjects takes over from there for state synchronization.

One transport-level bug worth flagging before you hit it yourself: Unity Transport can throw a “deallocated NetworkSettings” error when the settings object used to configure Relay data doesn’t live long enough. The fix is to allocate it with the persistent allocator rather than a temporary one.

using Unity.Collections;
using Unity.Networking.Transport;

// Wrong: temporary allocator gets disposed before Relay finishes using it
// var settings = new NetworkSettings(Allocator.Temp);

// Correct: persistent allocator survives until you explicitly dispose it
var settings = new NetworkSettings(Allocator.Persistent);

Build a small state machine around this flow rather than scattering async calls across multiple scripts. A simple enum (SigningIn, InLobby, ConnectingRelay, InGame) makes it far easier to show the right UI at the right moment and to catch the case where a player’s connection drops mid-handshake.

Steps 13-14: Configure Multiplay Hosting for Dedicated Servers

Relay and Lobby cover peer-hosted games well, but competitive titles or anything that needs server-authoritative logic usually wants dedicated servers instead. That’s what Multiplay Hosting provides, running your server build in Unity’s cloud rather than on a player’s machine.

  1. Step 13: Register a build configuration and create a fleet. In the Unity Cloud dashboard, under Unity Multiplay Hosting, upload your dedicated server build as a “build,” attach it to a “build configuration” (which bundles the binary, startup arguments, and environment variables), then create a “fleet,” which is the set of machines that will run that configuration across whichever regions you select. A fleet also defines server density, meaning how many server processes run per physical machine, and scaling rules for how aggressively it spins capacity up or down.
  2. Step 14: Allocate a server slot and connect players to it. When a match is ready to start, your matchmaker (or your own backend logic) sends an allocation request through the Allocations API, specifying the fleet and build configuration you want. Multiplay Hosting picks a server slot based on region and connection quality, starts the build if it isn’t already running, and returns the server’s IP, port, and allocation ID. Your client then connects directly to that server, and the server calls a deallocate request (or simply exits with code 0) when the match ends.

This is a genuinely different mental model from Relay. Relay routes traffic between a host player and other clients. Multiplay Hosting runs your actual server binary in Unity’s infrastructure and treats it as just another allocatable resource, closer to how AWS GameLift or Kubernetes-based orchestration like Agones would handle the same problem. If your game only needs casual peer-hosted sessions, you may never need to touch Multiplay Hosting at all, and Relay plus Lobby will get you most of the way there.

How UGS Multiplayer Compares to AWS GameLift and Kubernetes-Based Alternatives

Unity isn’t the only company selling a managed layer for multiplayer game infrastructure, and it’s worth understanding where UGS sits before you commit a project to it. AWS GameLift Servers covers similar ground with managed EC2 and container fleets, and its FlexMatch matchmaker plays a role close to what Lobby handles inside UGS, though FlexMatch can also run in a standalone mode decoupled from any specific hosting provider. AWS expanded GameLift’s hardware options in August 2026, adding 21 new EC2 instance types spanning both x86 and Arm architectures, including fifth-generation AMD EPYC, custom Intel Xeon 6, and AWS Graviton5 processors, which gives teams on that platform more control over the performance-to-cost ratio of their fleets than Unity currently publishes for Multiplay Hosting.

Kubernetes-based orchestration through a project like Agones takes a third approach: instead of a vendor-managed fleet abstraction, Agones runs as a set of custom resources on top of a Kubernetes cluster you already control, which trades some convenience for full infrastructure ownership. That model appeals to studios that already run Kubernetes for other backend services and don’t want a second, separate hosting relationship just for game servers.

None of these three approaches is universally correct. UGS Multiplayer’s real advantage is integration depth with the Unity Editor itself: Relay, Lobby, and Multiplay Hosting all ship as Unity packages with Editor-side tooling, so a solo developer or small team can go from a fresh project to a working matchmaking flow without leaving the Editor or standing up separate cloud infrastructure. AWS GameLift and Agones both assume more DevOps capacity on your team, but reward that investment with finer-grained control over hardware, networking, and cost. If your studio is already deep in AWS or already running Kubernetes for other services, that existing investment often outweighs the convenience of staying inside Unity’s own stack. If you’re building primarily in Unity and want the shortest path from prototype to a shipped multiplayer feature, UGS remains the more direct route.

Complete Working Project: A Minimal Lobby-to-Relay Matchmaking Flow

Putting all fourteen steps together gives you a self-contained sample scene that does the following: signs in anonymously on launch, shows a lobby browser with a Create and a Refresh button, lets a host spin up a Relay allocation the moment their lobby fills, writes the join code into lobby data automatically, and hands off to Netcode for GameObjects once every player has connected.

  • UgsBootstrap.cs from Step 6, attached to a persistent GameObject in your first scene.
  • LobbyManager.cs combining the create and query calls from Steps 10 and 11, with a heartbeat coroutine that pings LobbyService.Instance.SendHeartbeatPingAsync every 15 seconds so the lobby doesn’t expire while players are still choosing settings.
  • RelayHostManager.cs and RelayClientManager.cs from Steps 8 and 9, triggered by the LobbyManager once the host clicks Start.
  • A NetworkManager prefab configured with Unity Transport, referencing your player prefab and any scene-management settings Netcode needs.

Run the scene once as a build (not just in the Editor) and once from the Editor’s Play mode, then have the build create a lobby while the Editor instance joins it. If both connect and you see synchronized player objects moving in both windows, the full chain, sign-in through Authentication, discovery through Lobby, and transport through Relay, is working end to end. That two-instance test catches problems that testing purely inside the Editor’s multiplayer play mode tools sometimes misses, particularly around real network latency and NAT behavior.

A typical folder layout for this project keeps the UGS-facing scripts separate from your gameplay code, which makes the later step of swapping Relay for Multiplay Hosting (or adding both, gated behind a game mode setting) much less painful:

Assets/
  Scripts/
    Networking/
      UgsBootstrap.cs
      LobbyManager.cs
      RelayHostManager.cs
      RelayClientManager.cs
    Gameplay/
      PlayerController.cs
      MatchStateSync.cs
  Scenes/
    Bootstrap.unity
    LobbyBrowser.unity
    Gameplay.unity
Packages/
  manifest.json

Keeping the networking layer isolated this way also makes it realistic to unit-test your Lobby and Relay wrapper methods independently of gameplay logic, since you can mock the LobbyService and RelayService interfaces rather than spinning up a full scene for every test run. Once this structure is in place, adding a second connection path, say, falling back to Multiplay Hosting when Relay’s free-tier CCU cap is close to being hit, only touches the Networking folder rather than rippling through your gameplay code.

Unity Gaming Services Pricing in 2026: What Relay, Lobby, and Multiplay Hosting Actually Cost

Cost planning for UGS multiplayer means understanding three separate pricing models, since each service bills differently.

ServiceFree TierPaid RateBilling Unit
RelayFirst 50 average monthly CCU free$0.16 per additional average CCUAverage concurrent connections per month
Relay Bandwidth3 GiB per CCU free, capped at 150 GiB/month$0.09/GiB (Americas + Europe), $0.16/GiB (Asia + Australia)Egress bandwidth by region
Lobby10 GiB bandwidth free per region, per monthNot published as a flat per-GiB rate in Unity’s pricing docsSize of HTTP responses for create/join/query/heartbeat calls
Multiplay HostingNo published flat free tierMetered by CPU core-hour, RAM GiB-hour, OS license-hour, network egress, and storage GiB-monthResource consumption on running server instances

The Relay numbers are the easiest to plan around because Unity publishes flat per-CCU and per-GiB rates. Lobby is cheap enough for most indie projects that the 10 GiB per region free tier rarely gets touched, since a typical create/join/query/heartbeat cycle produces a tiny HTTP payload each time. Multiplay Hosting is the one that requires actual math, since it bills like a cloud VM rather than like a fixed per-player fee. Unity’s own documentation gives a worked example: a Windows machine with 2 CPU cores and 8 GiB RAM running for 2 hours in the us-east1 region costs roughly $0.126 in CPU time, $0.068 in RAM time, and $0.184 in Windows licensing, on top of whatever network and storage it consumes. Multiply that across a fleet running 24/7 and the bill adds up fast if you’re not actively scaling fleets down during off-peak hours.

Budgeting gets easier once you separate the three services by role rather than trying to estimate one combined “multiplayer cost.” Relay and Lobby scale with your player count in a fairly predictable way, since both are billed per connection or per API call volume, so a spreadsheet built from expected daily active users and an average session length gets you a reasonable Relay and Lobby estimate. Multiplay Hosting scales with server capacity instead, which means the cost driver isn’t how many players you have but how many concurrent match instances you’re running and how long each fleet stays warm between matches. A game with 10,000 daily players split across short two-minute matches needs far less standing server capacity than a game with 1,000 daily players in hour-long sessions, even though the second game has a tenth of the player count. Model your fleet sizing around concurrent match count, not total player count, and the Multiplay Hosting estimate becomes far more accurate.

5 Common Pitfalls When Building on UGS Multiplayer

1. Mixing standalone and unified packages in the same project. Some older tutorials still reference com.unity.services.relay and com.unity.services.lobby directly. Installing those alongside com.unity.services.multiplayer creates duplicate type definitions and confusing compiler errors. Pick one path, and for any project on Unity 2022 LTS or later, that path is the unified package.

2. Letting Relay allocations sit idle before starting the host. As covered in Step 8, allocations expire after roughly ten seconds without activity. If your UI flow shows a “preparing match” screen with a long animation before calling StartHost, move the allocation call to happen right before that transition instead of at the start of it.

3. Treating Lobby as a live game-state sync channel. Lobby is a matchmaking and discovery tool, not a general-purpose networking layer. Developers sometimes try to push frequent gameplay updates through Lobby’s data fields, which both breaks the intended usage pattern and runs straight into rate limits. Once a match starts, all real-time data should move through Relay and Netcode, not Lobby.

4. Forgetting that Multiplay Hosting fleets bill even when idle. A fleet configured with a minimum server count above zero keeps those machines running (and billing) regardless of whether players are connected. For projects with unpredictable traffic, configure autoscaling with a low or zero minimum rather than over-provisioning a fleet that sits mostly empty.

5. Skipping the system-clock check when authentication fails. Anonymous sign-in failures that look like a broken token exchange are frequently just a device with the wrong system time. This is especially common on test devices, VMs, and CI runners where the clock isn’t synced to a time server. Check the clock before you check your code.

Troubleshooting: 8 Errors You’ll Hit and How to Fix Them

ErrorLikely CauseFix
Join code not found / 404 (RelayServiceException)Allocation timed out before host bound, or host tried joining its own allocationCall StartHost immediately after allocation; never join your own allocation as host
Allocation ID not found / AllocationInvalidRelay allocation expired from inactivityCheck NetworkDriver.GetRelayConnectionStatus() and create a fresh allocation if invalid
ErrClientPlayerMismatchRelay message sent on an unrecognized connection, often from an outdated Relay package or an incomplete handshakeUpdate to Relay 1.2.0 or later; ensure host completes handshake before clients send data
NetworkSettings deallocated exceptionSettings object created with Allocator.Temp instead of a longer-lived allocatorUse Allocator.Persistent when constructing NetworkSettings for Relay
Client cannot connect after allocation succeedsHardcoded IP/port instead of values from the allocation responseRead IPv4Address and Port directly from the Relay allocation data
Relay allocation fails on older editorsEditor version below the package’s minimum supported versionUpgrade to a supported LTS release (2021.3.8f1 or later, depending on package)
[Lobby]: RateLimited (16429)Too many Lobby API calls in a short window, typically from polling every framePoll on a timer, add exponential backoff, debounce repeated UI actions
Token has expired during anonymous sign-inDevice system clock is incorrectSync device time to an internet time server, then retry sign-in

A quick pattern worth adopting across all of these: wrap every UGS call in a try/catch that distinguishes between an AuthenticationException, a RelayServiceException, a LobbyServiceException, and a generic RequestFailedException. Logging the specific exception type, rather than a generic “something went wrong” message, cuts debugging time dramatically because each of these carries an error code that maps directly to one of the rows in the table above.

Advanced Tips: Scaling Past the Free Tier

Once your project moves past prototype traffic, a few practices keep both cost and reliability under control.

  • Separate matchmaking logic from Lobby’s built-in query system. For anything beyond a simple public lobby list, pair Lobby with FlexMatch-style rule-based matching or your own backend logic, so players get grouped by skill or latency rather than just by whichever lobby they happened to click first.
  • Use restricted tokens for server-to-server calls. Authentication 3.7.0 introduced GenerateRestrictedTokenAsync, which issues a session token scoped down from a full player identity. Use it for backend services that need to call UGS APIs on a player’s behalf without holding their full credentials.
  • Right-size Multiplay Hosting fleet regions. Running fleets in every available region maximizes latency quality but multiplies your idle-capacity cost. Start with the two or three regions where your actual player base concentrates, then expand once analytics from the fleet dashboard justify it.
  • Monitor the Relay bandwidth cap. The 150 GiB/month combined free bandwidth ceiling is easy to blow through with even modest CCU once players start sending frequent state updates. If you’re seeing bandwidth charges appear unexpectedly, check whether Netcode’s tick rate or update frequency is higher than the gameplay actually needs.
  • Treat the March 2026 Multiplay Hosting transition as a migration deadline, not a footnote. Any project still referencing the classic Game Server Hosting APIs from before the cutover should be actively moving to the current fleet and build-configuration model, since Unity has already ended direct support for the old service.

For a broader look at how UGS multiplayer stacks up against alternative approaches to dedicated server hosting, Unity’s own multiplayer services overview covers the full product lineup, while independent comparisons like Gameye’s game server hosting rundown put Multiplay Hosting side by side with orchestration options such as Agones on Kubernetes and AWS GameLift for teams weighing which platform fits their scale.

Frequently Asked Questions

Is the standalone com.unity.services.relay package still usable in 2026?
Yes for projects on Unity versions before 2022 LTS, but Unity has deprecated it starting in Unity 6 and recommends the unified Multiplayer Services SDK for anything on 2022 LTS or newer.

What happened to Unity’s original Multiplay Game Server Hosting service?
Unity ended direct support for that original service on March 31, 2026, and has been transitioning the underlying infrastructure to what it calls Rocket Science, with new integrations built on the current fleet, build configuration, and allocation model instead.

Do I need Unity Multiplay Hosting if I’m only building a small co-op game?
Not necessarily. Relay plus Lobby handles peer-hosted sessions for most small multiplayer and co-op games without the added cost and complexity of running dedicated server fleets. Reach for Multiplay Hosting when you need server-authoritative anti-cheat logic or consistent server performance independent of a host player’s hardware.

How much does Relay cost for a small indie game?
The first 50 average monthly concurrent connections are free, along with 3 GiB of bandwidth per CCU up to 150 GiB total per month. Most early-stage indie projects stay comfortably inside that free tier before needing to budget for the $0.16 per additional average CCU rate.

Why does my Lobby keep expiring while players are still choosing settings?
Lobbies expire after a short period without a heartbeat ping. Run a coroutine or timer that calls LobbyService.Instance.SendHeartbeatPingAsync roughly every 15 seconds for as long as the lobby exists.

What Unity Editor version do I need for the unified Multiplayer Services SDK?
Unity 2022.3 LTS or later, including any Unity 6.x release. Projects on older editors should stick with the legacy standalone Relay and Lobby packages until they upgrade.

Can I use Netcode for GameObjects with Relay, or do I need a different transport?
Netcode for GameObjects works with Relay through Unity Transport’s RelayServerData configuration, which is exactly the pattern shown in Steps 8 and 9 of this guide. No separate transport package is required.

What’s the most common reason Relay connections fail during testing?
Timing. Either the host waits too long after creating an allocation before calling StartHost, letting the allocation expire, or the host mistakenly tries to join its own allocation as if it were a client. Both are covered in the troubleshooting table above.

Should I use Multiplay Hosting or AWS GameLift for a new project?
If your game is built in Unity and you want the shortest path from prototype to shipped feature without standing up separate cloud infrastructure, Multiplay Hosting’s Editor-integrated tooling is the faster route. Teams already invested in AWS, or that need the wider hardware selection AWS GameLift added in its August 2026 EC2 expansion, may find the extra setup work worth the added control.

Related Coverage

Elias Virtanen

Elias Virtanen

Cybersecurity Analyst

Elias Virtanen is the Cybersecurity Analyst at Tech Insider, bringing hands-on expertise from his background in penetration testing and security consulting. He previously worked as a security researcher at F-Secure in Helsinki, where he focused on threat intelligence and vulnerability disclosure. Elias covers ransomware trends, zero-trust architecture, and the evolving regulatory landscape including NIS2 and the EU Cyber Resilience Act. He holds a CISSP certification and an MSc in Information Security from Aalto University.

View all articles