[Mirror] Reloading a Scene does not spawn networked Objects

Hey everyone,

it’s again me with another problem related to reloading the active scene. As we know, a newly loaded scene is removed from all networked objects. At the moment where the local machine becomes the server, it spawns all the networked objects and keeps them in sync with every client connecting to this server. But when I reload the active scene with
NetworkManager.singleton.ServerChangeScene(SceneManager.GetActiveScene().name);,
the newly loaded scene is again purged from all networked objects, although I do already have a server!

Why does my server not care about spawning in the objects?

Thanks for any advice in advance.

I finally found the cause of the issue. The problem I explained above was just at the end of a chain of issues.

Our problem was that our NetworkManager Component was attached to an object that was not parented to the scene’s root. For some reason, this leads to the issue that the NetworkManager does not execute the “DontDestroyOnLoad” command successfully. Therefore, by reloading the scene our NetworkManager gets destroyed and is replaced by a new one present in the new scene. Anyways… moving the NetworkManager up to the top in the hierarchy fixed all issues.

1 Like