Sync rotation and animator states

Hello! I want to syncronize rotation and animator states (idle, run => trigger,bool, float) of main enity (RPG-character) . I was able to sync position with this:

Client side:

public void MoveOperation(float x, float y, float z)
{
PhotonPeer.OpCustom((byte)OperationCode.Move,
new Dictionary
{
{(byte) ParameterCode.PosX, x},
{(byte) ParameterCode.PosY, y},
{(byte) ParameterCode.PosZ, z},

}, false);
}


Server side:

case (byte)OperationCode.Move:
{
var moveRequest = new Move(Protocol, operationRequest);
if (!moveRequest.IsValid)
{
SendOperationResponse(moveRequest.GetResponse(ErrorCode.InvalidParameters), sendParameters);
return;
}

Position = new Vector3Net(moveRequest.X, moveRequest.Y, moveRequest.Z);

var eventData = new EventData((byte)EventCode.Move);
eventData.Parameters = new Dictionary {
{ (byte)ParameterCode.PosX, Position.X },
{ (byte)ParameterCode.PosY, Position.Y },
{ (byte)ParameterCode.PosZ, Position.Z },
{(byte)ParameterCode.CharacterName, CharacterName }
};

eventData.SendTo(World.Instance.Clients, sendParameters);

}
break;


Can you give me some advices , thx!
Sign In or Register to comment.