Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Mirror AdditiveLevels example. how to unload correctly from host?

Discussion in 'Multiplayer' started by eitanbariboa, Jan 26, 2022.

  1. eitanbariboa

    eitanbariboa

    Joined:
    Mar 19, 2020
    Posts:
    26
    Hello i got a problem in mirror
    i would like to unload scene for the host but without removing the level like in the AdditiveLevels example but i can't seem to replicate it.
    It does work for clients but for host the objects are still visible from both scenes
    how do i hide them? the same as the example, when the client change scene and when the host change scene both of the item the objects of the previous scene are hidden.
    The issue is that i see the objects from the previous scene. this isn't getting called in the host but still works in the additive example
    Code (CSharp):
    1.          if (mode == NetworkManagerMode.ClientOnly)
    2.             {
    3.                 yield return SceneManager.UnloadSceneAsync(sceneName);
    4.                 yield return Resources.UnloadUnusedAssets();
    5.             }