Hello !
I have a game that when player login to the game, they will host themself and enter “scene A”. Then I use Netcode for Gameobject service “Matchmaking” to matchmake “Player A” with “Player B”.
I tried to Shutdown the Host by player and connect to deliciated server by StartClient(). But I got error “Cannot start client while an instance is already running”.
One thought: I tried to link my problem with when the game have multiple lobby and join one game server, how pro do it ? Like PUBG, each room have 4 player and move to big scene. I mean how “pro” handle shutdown lobby and join big game scene ?
Thanks for advice !
public bool StartMyClient()
{
if (NetworkManager.Singleton.IsConnectedClient)
{
NetworkManager.Singleton.Shutdown();
}
var success = NetworkManager.Singleton.StartClient();
if (success)
{
//NetworkManager.Singleton.SceneManager.OnSceneEvent += SceneManager_OnSceneEvent;
IsClient = true;
BindSceneEvent();
}
return success;
}