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 Difficulty using SceneLoaderWrapper from multiplayer samples

Discussion in 'Multiplayer' started by mattseaton22, Oct 16, 2022.

  1. mattseaton22

    mattseaton22

    Joined:
    Sep 12, 2019
    Posts:
    26
    I am using the Boss Room game as a template for implementing my own logic. I'm trying to copy what Unity did, but one thing is not working right for me.

    When I use SceneLoaderWrapper.LoadScene with useNetworkSceneManager = false, the OnSceneEvent callback does not get fired.

    I have implemented a quit menu to take the user back to the main menu. This works. However the client loading screen shows up and because the callbacks are not fired it does not disappear once loading is complete. It overlays the main menu. What am I missing here? This didn't happen in the boss room demo, but they also set useNetworkSceneManager to false when going back to the main menu.

    OnSceneEvent is also not fired in the BossRoom demo. I see there is a StopLoadingScreenClientRpc at the bottom of the script, but it also appears to not be fired when I return to the main menu. Where is the logic that hides the loading screen after returning to the main menu?

    And more generally, is there a way for me to follow the code line by line during execution so I can figure this stuff out myself? I don't understand how to properly debug event driven code. I have trouble tracking down the original code that fires callbacks. So debugging anything is taking me forever. There has to be a better way to do this.
     
  2. mattseaton22

    mattseaton22

    Joined:
    Sep 12, 2019
    Posts:
    26
    Suddenly it's working as expected. I have no idea what changed.