Problem with animation RPC in Photon

Hello guys, I need lots of help.

I have this code below that runs the animation via photon. Everything works normally, both local pc and the remote player, but still of a small locked when I put the animation via RPC.

I already placed the moviment smooth and works perfectly without stalling. The only problem is when I add the RPC al waged in some small movement.

I wonder if possesses some other way to add animation via photon, both I, as the remote player can see the animations.

public Animation PlayerAnimacao;

if (Input.GetMouseButton (0)){
...
photonView.RPC("MultipAnimation", PhotonTargets.AllBuffered, "Run");
}

[RPC]
void MultipAnimation(String animState){

if(!photonView.isMine){
   PlayerAnimacao.animation.CrossFade(animState);
}
}

Already, many thanks to those who help me.

When I was playing around with Photon and Animations, I found that the Mechanim was best for my requirements.

I used the OnPhotonSerializeView() method to stream the speed and direction of each player and then use these as parameters for the mechanim, which would then handle switching animation states as well as blending them.

Mechanim tutorial: 1

Marco Polo (Photon Tutorial - great chapters on sync’ing position and later adding animations): 2

Hope this is somewhat A help to you. Good luck :slight_smile: