issues with scene loading in a VR Multiplayer game

Options
I'm working on a Multiplayer VR game, where a player can join up to 3 other players in a main hub room, designed mostly for socializing but also the area you can use to customize your player and such. After which they are able to load into different scenes that have combat and such.

However what we wanted to do is have say, the master client already loaded into another scene, one to do with combat and such, and have a player that has just joined their room, able to load into that scene when they are ready, so they don't necessarily have to be loaded into the same scene, but when they decide to are able to load into that scene.

Currently SteamVR.LoadLevel is being used, because of how it loads scenes asynchronously the issue is that with this, if I were to have the master client load a different scene then have a player join and load after the scene is loaded and such, neither player can see each other. Am I able to have them just load in and sync with the master client's scene?

I've played around with PhotonNetwork.automaticallySyncScene setting this to true, which loads the joined player into the scene that the master client is in, however being a vr game, this needs to be done asynchronously and also at the join players request.

Comments

  • Hi @f03n1x,

    do you have to use a separate scene for this scenario or is it maybe enough to just use a separate area within the same scene, where the players can customize their characters / battle each other.

    [...] neither player can see each other.


    This seems to be an issue with scene loading and the instantiated object might be creating in the old scene before the new one gets loaded. You can check this by adding some Debug Logs to the object and the scene and see in which order the logs occur in the console. If the objects are instantiated in the old scene, you can try to mark them as DontDestroyOnLoad and see if this fixes the issue and does not lead to other problems.
  • f03n1x
    Options
    Hi @Christian_Simon Thanks for the reply!

    Sadly each battle scene is a massive map, so it isn't an option to have it in one scene, I've ended up modifying PhotonNetwork to include sync when players are in the same scene, with the choice of the joined player to go to the same scene at any time through the use of custom properties and UnityEvents, it's worked out well.

    The issues with not seeing each player was because I didn't exactly understand how PhotonNetwork.LoadLevelAsync, I set it up so that only the master client would do this which was just my bad for not understanding. I ended up adding in a similar method to it but changed out the async loading with SteamVR's Async loading that we currently use and it works out well.