Im having a big problem using Photon PUN networking with Unity multiplayer game.
The Master Client receives a list of networked SCENE objects to create from the server.
The Master Client creates all the scene objects ONCE like this psudo code
void OnLevelLoaded()
{
if (MasterClient) {
for (i=0; i<object.Count; i++) {
PhotonNetworking.InstantiateSceneObject(object[i],....)
}
}
CreatePlayer();
}
When other players join the room, the server (or some other entity, dont know who) automatically creates those same networked scene objects on the client players.
Lets say a player picks up a scene object, the master client sends this as a buffered RPC to all clients so that they can pick it up too.
PROBLEM: When new player joins, he immediately gets a bunch of RPC calls to pick up objects, even when the scene objects are not yet instantiated automatically by the server, so of course the RPC cant find the objects since they are not created yet, and the program fails.
If there was someway the server could instantiate the scene objects first, then send the RPC it would be great, but i dont know how to control that, it seems to be done behind the scenes automatically.
Anybody knows how I can fix this problem? Im so desperate, I been searching for answer for two days.
Thanks