Search Unity

Third Party PUN 2 Loading Scene Async progress issue??

Discussion in 'Multiplayer' started by dick, May 30, 2022.

  1. dick

    dick

    Joined:
    Sep 6, 2014
    Posts:
    91
    Hello,

    When loading the game-scene (from the menu) for the first time using PUN, then checking the scene-loading progress using PhotonNetwork.LevelLoadingProgress > 0f, it works as it should.

    But when I return from the game-scene to the menu-scene, the value of PhotonNetwork.LevelLoadingProgress is = 1. (fully loaded)

    How would I be able to check for the scene loading progress again if trying to load the game-scene again?

    Thank you!
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066
    Internally, PUN stores a _AsyncLevelLoadingOperation, when it synchronizes the scene used in a room.
    If you are not in a room, this is probably null and won't show correct progress.
    When you join another room, PUN checks if some room name or index is set and will load that scene and again show the progress.

    So, if you load scenes while not in a room, use the Unity APIs to show progress.