Widget not interactable after NetworkManager.Shutdown

Hi,

I am using the Netcode for unity with Unity.Multiplayer.Widgets

I can correctly launch an host and connect client to the lobby to play my game.

I am now looking at how disconnect/back to main menu.

I do call (on server only currently):

        NetworkManager.Singleton.Shutdown(true);
        SceneManager.LoadScene("MainMenuScene");

It seem to work correctly, but my problem is that all the Unity.Multiplayer.Widgets are not interactable when coming back to the scene. If I make them interactable through the inspector and create a new lobby, it seem to work well.

So my question is, do you have some clue on what I can miss which prevent those widget to become interactable again?

Thanks,

I don’t know if this is relevant as I’ve not used Widgets but Shutdown only kicks off the shutdown process. Have the server subscribe to NetworkManager.Singleton.OnServerStopped to know when shutdown is complete.

Hi @Zeldarck!

It sounds like you’re shutting down the NetworkManager but still keeping the active session open.
As long as the player is part of a session the Widgets will be disabled so that they cannot join another session.
To leave the session you can use the “Leave Session Widget” - this will also automatically shut down your NetworkManager. Same as joining a session will automatically start it.

Another hint: The Widgets expose some UnityEvents so you can react when a session was joined or left. You can hook up a script to load a scene instead of hardcoding it.

Let me know if that works for you!