Using Unity.Services.Lobby is not working

Hi again, i am making my Lobby for my game and following a tutorial. but when I try to use using Unity.Services.Lobbies and Unity.Services.Lobbies.Models I get the error: Assets\Scripts\LobbyManager.cs(40,35): error CS0433: “The type ‘LobbyService’ exists in both ‘Unity.Services.Lobbies, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’ and ‘Unity.Services.Multiplayer, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’” and “Assets\Scripts\LobbyManager.cs(40,8): error CS0433: The type ‘Lobby’ exists in both ‘Unity.Services.Lobbies, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’ and ‘Unity.Services.Multiplayer, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null.’” Can anyone help me?

Hey @Razorduck123!

The error there suggests that there are multiple assemblies (Unity.Services.Lobbies & Unity.Services.Multiplayer) in your project that are both defining the same types.

A likely cause here could be that you have both the standalone Lobby package (com.unity.services.lobby) and the new unified Multiplayer package (com.unity.services.multiplayer) installed.

The new Multiplayer package embeds the APIs from the standalone Lobby package, so there is no need to install both.

You can read more in the migration guide.

Thanks for that @Unity-Luke but even when I use the documentation, I get messages saying that I can’t use the type “Lobby” and “LobbyService” in my code. What do I do here, do I have to reference something at the start of my code?

Can you post a stripped down version of your script that reproduces this issue? You should have import statements like this that allow using the namespaces:

using Unity.Services.Lobbies;
using Unity.Services.Lobbies.Models;

Are you using Unity 2022 or Unity 6? Seeing your Packages/manifest.json would also be helpful. Also consider restarting your IDE and Unity editor after uninstalling the dedicated Lobby SDK package, just in case your devtools didn’t pickup the changes.

Hi @mcanfield_unity I am using unity 6 and is now just using the new mulitplayer SDK. here is my code:

    private async void CreateLobby()
    {
        string lobbyName = "new lobby";
        CreateLobbyOptions options = new CreateLobbyOptions();
        options.IsPrivate = true;

        Lobby lobby = await LobbyService.Instance.CreateLobbyAsync(lobbyName, maxPlayers, options);
    }
}

Could this help(I don’t know how to show you my package…). thanks for helping so fast!

Here are also all my references:

using UnityEngine;
using Unity.Services.Core;
using Unity.Services.Authentication;
using Unity.Services.Multiplayer;
using TMPro;
using UnityEngine.UI;

hello, can anyone help?

Nvm just deleted new multiplayer package and went to old LObby system