Unity3D Scene not syncing

When connecting a new player, all objects that were created with the help of PhotonNetwork.Instantiate() are not created. But PhotonNetwork is specified that scene must be synchronized. Loading scene using PhotonNetwork.LoadLevel()


  • It's not clear when you call PhotonNetwork.Instantiate() and when PhotonNetwork.LoadLevel()
    Take a look at DemoWorker for a loading level sample.
  • I'm having the same issue. The WebGL game I'm working on has an initial scene where the player can select their handle for the chat room and their Player Character's body. From there, the level scene is loaded. Once OnLevelWasLoaded(int level) is called called on the NetworkedGameManager, the NetworkedGameManager will join a room. When OnJoinedRoom() is called, I call PhotonNetwork.Instantiate(....) to create the Player Character's body. The issue I'm having is that the players that are already in the room don't show up for that client. Yet, player's that join the room after the client do show up.
  • @Xytabich: Are you using WebGL, too?

    We could use a simple repro case for this. Or please check if the "Worker Demo" has the same issue in WebGL. Then we could better take a look next week.
  • We can't reproduce the issue. Can you send a repro case or more details?
  • Sorry about the delay in my response. It was a few days before I was able to get around into looking into this. I was able to find the problem after I updated the project, the code, and assets to the latest versions. Once I did that, the problem would also show up on the editor and not just the browser. And, it went from not displaying people whom were in the room before you to not displaying anyone. Odd, but at least the problem was more consistent making it easier to track.

    I was using a slight variation of the Networked Player code from the Marco Polo demo. It looks like one of values for at least one of the float components of the _correctPlayerRot Quaternion were being initialized to NaN. This resulted in non-client player characters being placed in a location that wasn't anywhere close to the starting point. It also caused their positions to not be updated when they moved on their client. So, even if a client sent out the correct position and rotation, the other clients were unable able to update their version of the other player's rot-pos because there was a NaN somewhere in their copy of that player's rotation causing the Quaternion.Lerp() function to throw an exception.

    To fix this issue, I gave the _correctPlayerRot an explicit default value within the Start() method of the NetworkPlayer script. I have to say, I find it odd that this was not an issue for either the PC build or the WebPlayer build. Well, WebGL is the new kid on the block, so there's probably all sorts of odd behavior going on under the hood.