# Matchmaking never found each other using Nakama SDK Unity

**URL:** <https://forum.heroiclabs.com/t/matchmaking-never-found-each-other-using-nakama-sdk-unity/6396>\
**Category:** Local Setup\
**Created:** [September 7, 2025, 12:40pm UTC](https://forum.heroiclabs.com/t/matchmaking-never-found-each-other-using-nakama-sdk-unity/6396 "2025-09-07T12:40:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gesekanmagnet](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/gesekanmagnet/32/2628_2.png) [@gesekanmagnet](https://forum.heroiclabs.com/u/gesekanmagnet)\
**Post date:** [September 7, 2025, 12:40pm UTC](https://forum.heroiclabs.com/t/matchmaking-never-found-each-other-using-nakama-sdk-unity/6396/1 "2025-09-07T12:40:42Z")

</div>

I try to create a match with matchmaker following this tutorial: [https://youtu.be/-ZpmZo6ZvIo](https://youtu.be/-ZpmZo6ZvIo)

Tickets are created on both client, matchmaker set with minCount: 2 and maxCount: 2, with default query, but they have never met. I am using Unity 6 Nakama SDK version 3.15.0

```auto
using UnityEngine;

using Nakama;

public class Matchmaking : MonoBehaviour
{
    private bool isMatched;
    private string matchId;

    private void OnEnable()
    {
        EventCallback.OnLoggedin += LoggedIn;
        EventCallback.OnMatchEnd += MatchEnd;
        EventCallback.OnGameOver += Disconnect;
    }

    private void OnDisable()
    {
        EventCallback.OnLoggedin -= LoggedIn;
        EventCallback.OnMatchEnd -= MatchEnd;
        EventCallback.OnGameOver -= Disconnect;
    }

    private void LoggedIn()
    {
        Connector.socket.ReceivedMatchmakerMatched += OnReceiveMatchmakerMatched;
        Connector.socket.ReceivedMatchState += OnReceiveMatchState;
    }
    
    /// <summary>
    /// Find match through matchmaking
    /// </summary>
    public async void FindMatch()
    {
        await Connector.socket.AddMatchmakerAsync(minCount: 2, maxCount: 2);
        try
        {
            Debug.LogError("Finding");
        }
        catch (System.Exception e)
        {
            Debug.LogException(e);
            throw;
        }
    }

    /// <summary>
    /// Match finished, sending the winner player session
    /// </summary>
    /// <param name="session">Winner session</param>
    private async void MatchEnd(ISession session)
    {
        if (!isMatched) return;

        await Connector.socket.SendMatchStateAsync(matchId, 1, session.Username);

        EventCallback.OnGameOver(Connector.session.UserId.Equals(session.UserId) ? GameResult.Win : GameResult.Lose);
        Debug.Log(session.Username + ": completed the game");
    }

    private async void OnReceiveMatchmakerMatched(IMatchmakerMatched match)
    {
        EventCallback.OnMatchFound();
        var join = await Connector.socket.JoinMatchAsync(match);
        try
        {
            isMatched = true;
            matchId = match.MatchId;
            Debug.Log(matchId);
            foreach (var item in join.Presences)
            {
                Debug.LogError(item.Username);
                
            }
            EventCallback.OnMatchStart();
        }
        catch (System.Exception e)
        {
            Debug.LogError(e.Message);
            throw;
        }
    }

    private void OnReceiveMatchState(IMatchState matchState)
    {
        if (matchState.OpCode == 1)
        {
            EventCallback.OnGameOver(GameResult.Lose);
        }
    }

    private async void Disconnect(GameResult gameResult)
    {
        if (!isMatched) return;
        await Connector.socket.LeaveMatchAsync(matchId);
    }
}

```

📺 **Media:**

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [September 8, 2025, 9:37am UTC](https://forum.heroiclabs.com/t/matchmaking-never-found-each-other-using-nakama-sdk-unity/6396/2 "2025-09-08T09:37:20Z")

</div>

Hi @gesekanmagnet,

Please upgrade to the latest version of the server and of the SDK, we aren’t aware of any issues, this test is successful: [nakama-dotnet/Nakama.Tests/Socket/WebSocketMatchmakerTest.cs at master · heroiclabs/nakama-dotnet · GitHub](https://github.com/heroiclabs/nakama-dotnet/blob/master/Nakama.Tests/Socket/WebSocketMatchmakerTest.cs#L58)

Best
