기술 자료

​
​

Development

User Acquisition

Monetization

산업 분야

Multiplayer Services SDK

All Services

Multiplayer Services SDK

이 페이지는 선택한 언어로 제공되지 않습니다.
Multiplayer
​
​
Multiplayer Services SDK
  • Overview
  • Get started
  • Use multiplayer sessions
  • Manage sessions
  • Connect players through a relay
  • Networking
  • Matchmaking
    • Get started with matchmaking
      • Matchmaking ticket flow
      • Authentication
      • Matchmaking rate limits
      • Queues and pools
      • Matchmaker hosting providers
    • Manage and configure matchmaking
    • Matchmaker troubleshooting
    • Integrations with other UGS services
    • Deploy Matchmaker configurations
  • Monitor and debug sessions
  • Tutorials
  • Reference
  1. Multiplayer Services SDK

Get started with matchmaking

Install and set up Matchmaker and create your first matching ticket.
읽는 시간 4분
최근 업데이트: 15일 전

Match players together in games using the Multiplayer Services SDK. Enable Matchmaker, create the first matchmaking ticket, and create a hosting provider allocation.

Configure your hosting

Before enabling Matchmaker, initialize your chosen hosting solution, or a client-hosted solution provided by Unity. Refer to Connect players, and the Distributed Authority Quickstart for details about using these services with Matchmaker.

Install the Multiplayer Services SDK

Follow the Install the Multiplayer Services SDK documentation to install the Multiplayer Services SDK.

Set up Matchmaker

You can set up and manage Matchmaker through the Unity Dashboard:
  1. In the Unity Dashboard, go to Development > Products.
  2. Select Matchmaker.
When you launch Matchmaker for the first time, this adds Matchmaker to the Shortcuts section on the sidebar and opens the Overview page.

Create a queue and a pool

The next step in working with Matchmaker is to set up a queue and pool to control how Matchmaker groups and matches tickets.
If you use a game hosting provider, you must use Cloud Code's allocation function to return allocation data from the hosting provider. Refer to Matchmaker hosting providers for more information.
To create a queue and pool, follow these steps:
  1. Select Queues > Create queue.
  2. Choose a name for the first queue and set the maximum number of players on a matchmaking ticket.
  3. Select Create.
  4. Select the queue you just created, then in the Pools tab, select Create pool.
    • Choose a name for the pool.
    • Choose the queue that you created in the previous step.
    • Select a Pool type.
    • Set the timeout value for a ticket. Select Next.
  5. Select your hosting type:
    • If you're using a hosting provider, select Hosting via Cloud Code, then in the dropdown menu, select the Cloud Code Module Name that contains the allocation and poll functions for your hosting provider.
    • If you're using a client-hosted solution provided by Unity, select Client Hosting.
  6. Select Next.
  7. Specify the rules used to define the matches created when sending ticket to that queue and pool. Select JSON and copy/paste the following block of code to create matches of one team with a minimum of one player and a maximum of five players:
{ "Name": "Test", "MatchDefinition": { "Teams": [ { "Name": "Main team", "TeamCount": { "Min": 1, "Max": 1 }, "PlayerCount": { "Min": 1, "Max": 5 } } ], "MatchRules": [] }, "BackfillEnabled": false}
  1. Select Create at the bottom of the page.
Matchmaker is now configured. In the Matchmaker section, select Queues to check the queue and pool that were created.
중요
Before using a hosting provider, refer to Matchmaker hosting providers to integrate Cloud Code modules to allocate game servers and coordinate matchmaking results.

Create a matchmaking ticket

Now that the matchmaker is configured, you can create and send a ticket to request a hosting allocation:

Unity SDK

using System;using System.Collections.Generic;using System.Threading;using System.Threading.Tasks;using Unity.Services.Authentication;using Unity.Services.Core;using Unity.Services.Multiplayer;using UnityEngine;public class MatchmakerExample : MonoBehaviour{ ISession m_Session; CancellationTokenSource m_MatchmakingCts; async void Start() { await UnityServices.InitializeAsync(); await AuthenticationService.Instance.SignInAnonymouslyAsync(); await StartMatchmakingAsync(); } async Task StartMatchmakingAsync() { m_MatchmakingCts = new CancellationTokenSource(); var matchOptions = new MatchmakerOptions { QueueName = "MyQueue", // Optional: filters/attributes used by pool rules TicketAttributes = new Dictionary<string, object> { { "gameMode", "ranked" } }, // Optional: per-player custom data used by matchmaking rules PlayerProperties = new Dictionary<string, PlayerProperty> { { "skill", new PlayerProperty("1200") } } }; var sessionOptions = new SessionOptions { MaxPlayers = 5 }.WithRelayNetwork(); // or .WithDistributedAuthorityNetwork() for Distributed Authority try { m_Session = await MultiplayerService.Instance.MatchmakeSessionAsync( matchOptions, sessionOptions, m_MatchmakingCts.Token); Debug.Log($"Match found and session joined: {m_Session.Id}"); } catch (SessionException e) { Debug.LogError($"Matchmaking failed: {e.Message}"); } } // Cancel matchmaking public void CancelMatchmaking() { m_MatchmakingCts?.Cancel(); }}

CURL

# Fetch anonymous tokencurl -X POST -H "ProjectId: <projectId>" https://player-auth.services.api.unity.com/v1/authentication/anonymous# Call the create ticket endpointcurl -X POST -H "Authorization: Bearer <TOKEN>" \-H 'Content-Type: application/json' \--data-raw '{ "queueName": "Default", "attributes": {}, "players": [{ "id": "Player 1", "customData": {} }]}' \'https://matchmaker.services.api.unity.com/v2/tickets'
참고
Player IDs must be different to be matched together.

REST API

https://services.docs.unity.com/matchmaker/v2/index.html#tag/Tickets/operation/createTicket

Copyright © 2026 Unity Technologies
법률 정보개인정보 처리방침쿠키Documentation Terms of Use개인 정보 판매 또는 공유 금지개인정보 보호 선택(쿠키 설정)

'Unity', Unity 로고 및 기타 Unity 상표는 미국 및 기타 지역 내 Unity Technologies 또는 그 계열사의 상표 또는 등록상표입니다(자세한 내용은 여기에서 확인하세요). 기타 명칭 또는 브랜드는 해당 소유자의 상표입니다.

일부 페이지는 편의를 위해 기계 번역되었으며 부정확한 내용이 있을 수 있습니다. 정보가 상충되는 경우, 영어 버전을 우선으로 참조하세요.

  • 보고 있는 페이지
    • Configure your hosting

    • Install the Multiplayer Services SDK

    • Set up Matchmaker

    • Create a queue and a pool

    • Create a matchmaking ticket

      • Unity SDK

      • CURL

      • REST API


이 페이지의 문제 보고