- Home /
Question by
XanzUnity · Jul 27, 2017 at 08:34 AM ·
animationnetworkingrpc
[Unet] Network Animation and Bone Rotation using RPC
So I am trying to sync my animations using local state parameters as the network animator is extremely clunky and often times does not work. Plus it would reduce the server load by having the animations be ran locally instead of having them synced on the server. I am also attempting to find out how to sync the bone rotation of the spine over the network but I think I will be able to figure it out once I can get the animations working correctly with RPC.
Issue 1: Currently every player will have the animations played instead of just the one that is performing an action. Issue 2: The other players cannot see the animations being played. Issue 3: Spine Rotation plays for every character.
//This here sets the parameteres correctly for the script.
void Animate()
{
//This is the move forward and backward animation.
animator.SetFloat("Forward", Forward);
//This is the move left and right animations.
animator.SetFloat("Strafe", Strafe);
//This is the idle animations and ground check.
animator.SetBool("isGrounded", grounded);
//This is the Jump animation.
animator.SetBool("isJumping", jumping);
}
[Command]
void CmdMove(float Forward, float Strafe, bool grounded, bool jumping)
{
RpcMove(Forward, Strafe, grounded, jumping);
}
[ClientRpc]
void RpcMove(float Forward, float Strafe, bool grounded, bool jumping)
{
if (isLocalPlayer)
return;
Animate();
}
Any help would be appreciated.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612130800im_/https://answers.unity.com/themes/thub/images/avi.jpg)