ViewID different client and server

Options
Good afternoon, help me deal with Photon Network.

The game only 2 players.

If the first player enters the room, then I do:
GameObject pawnwhite = PhotonNetwork.Instantiate (whitepawn.name, go.transform.position, Quaternion.identity, 0);
whitefiguresIDviewID = whitefiguresIDviewID +1;
pawnwhite.GetComponent <PhotonView> (). viewID = whitefiguresIDviewID;
pawnwhite.transform.SetParent (figures.transform);
whitefigures.Add (pawnwhite);
That is, I place the figures on the battlefield and assign them a viewID.

If three times a player enters the room, then as PhotonNetwork.automaticallySyncScene = true, the figures are correctly placed on the battle pothole, but the same shapes are different viewID, although I understand that they should be the same.

Tell me what I'm doing wrong. Sorry for my English.

Comments

  • Hi @LexaMV,

    you don't have to set the View ID manually, when using PhotonNetwork.Instantiate for Instantiation. In this case the necessary View ID gets assigned automatically.

    You only would have to assign the View ID manually, if you are using Manual Instantiation, which is currently not the case.

    One hint: you are currently using the SetParent function and a whitefigures.Add call. Both calls are only processed on the local client, the one who is calling PhotonNetwork.Instantiate. If you want to have those changes on all clients, you would have to synchronize them. The SetParent call for example can be moved into the object's Awake function, in order to get called automatically on every client.