Most networking APIs require that we filter input (or adjust prefab config) to avoid every player controlling everybody else's. PUN uses PhotonView.isMine for this. Since I don't know what makes a prefab 'mine' I guess being the client calling Network.Instantiate is what does it.
with tweaks, PhotonTransformView works well. In my case physics are important, my setup:
I set remote prefabs to kinematic otherwise local physics interact (poorly) with remote sync.
Spawn location
For generating spawning positions, I used the player joining order
(calling PhotonNetwork.otherPlayers.Length inside OnJoinedRoom).
In Photon, Disconnect() appears to correctly exit the 'room' and disconnect the client.
Time spent: ~2-3 hours
No comments:
Post a Comment