get or set the player rotation. The variable "Rotation (synched) is serialized across photon network.
This is a critical Fsm.
Synching the player position
The variable "Position (synched)" is defined and serialized across photon network within the Variable synch repository fsm.
If we are the owner of this object ( that it represents OUR player), then we MUST set the variable "Position ( synched)", this is our duty so that other instances ( your player representation on other running applications) can watch for changes.
So if we are the owner, we move to the state "Get the player position", in there we get the animation state and set the the variable "Position ( synched)" to match. If we are not the owner, we move to the state "Set player position with lerp", and we first get the variable "Position ( synched)" and we set the position of the gameObject, but with a twist. We do not directly set the position, instead we lerp it, which smoothes out the movement, else if the network is slow, you would have hick ups as the network data synchronization is not reliable in terms of constant update.
Photon Actions used:
- Photon View Is Mine( in state "IsMine?")