PhotonNerwork.Instantiate Not syncing objects

Options
Hey everyone,

I have two players, the first player can join a room and is able to see anyone who join later.
The second player however, will join the room but won't see any players joined already. (so won't see the first player).

I've never had this issue before and couldn't find any solutions online, I hope I just missed something easy here's the code:

We connect and join a room then OnJoinedRoom we load the next scene where this runs:

private void Start() { print(PhotonNetwork.connectionStateDetailed); StartCoroutine(SpawnDelay()); } public IEnumerator SpawnDelay() { yield return new WaitForSeconds(5); PhotonNetwork.Instantiate(player.name, new Vector3(10, 0, 10), Quaternion.identity, 0); }

Comments

  • Hi @zotey,

    the problem is that the message containing the Instantiation of the object of the first player will arrive directly after having joined the room and will be processed immediately. So I guess it will be handled before loading the next scene so that the instantiated object gets removed when the next scene is loaded. Instead of loading the scene from the OnJoinedRoom callback for non-MasterClient clients you can try setting PhotonNetwork.automaticallySyncScene to true before creating the room and see if this helps solving the problem.