- Home /
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.
Answer by Jellezilla · Feb 07, 2014 at 09:35 AM
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: link
Marco Polo (Photon Tutorial - great chapters on sync'ing position and later adding animations): link
Hope this is somewhat A help to you. Good luck :)
Your answer
Follow this Question
Related Questions
RPC Player Name and show it above head 0 Answers
More efficient way to call these RPC's (Code works) 1 Answer
Make an animation play over RPC call? 1 Answer
Network RPC find sender gameobject 2 Answers
RPC Acting strangly 1 Answer