Photon and animation rigging

Options
Atix
Atix
Hello!

Im using Unity's animation rigging package to create head look and spine control for FPS controller which is controlled by position of the rig targets. So according to that Im moving rig targets according to players body and syncing it to all players like in this photo:

WDoc4F.png

Here is the code:
void LateUpdate() //animation rigging
    {
        if (!PV.IsMine)
            return;

        headAngleY += mouseY;

        headAngleY = Mathf.Clamp(headAngleY, 0, 140); //Vücut sınırlama

        spinePos = new Vector3(0, Mathf.Sin((headAngleY + offset) * Mathf.Deg2Rad), Mathf.Cos((headAngleY + offset) * Mathf.Deg2Rad));
        spineTarget.transform.localPosition = spinePos;

        headPos = new Vector3(yRotation * Mathf.Deg2Rad, Mathf.Sin(((headAngleY - 90) + offset) * Mathf.Deg2Rad), Mathf.Cos(((headAngleY - 90) + offset) * Mathf.Deg2Rad));
        headTarget.transform.localPosition = headPos;
    }

    public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
    {
        if (stream.IsWriting)
        {
            stream.SendNext((Vector3)spineTarget.transform.localPosition);
            stream.SendNext((Vector3)headTarget.transform.localPosition);
        }
        else
        {
            this.spineTarget.transform.localPosition = (Vector3)stream.ReceiveNext();
            this.headTarget.transform.localPosition = (Vector3)stream.ReceiveNext();
        }
    }

But its not smooth on other players body. Its like its skiping frames. Not like normal walking & crouching animations.

https://www.youtube.com/watch?v=aDXqsIX2lEo

Any help and idea would be great! Thank alot.



Comments

  • Talane
    Options
    Any updates about this? did you manage to fix it? I'm new with animation rigging and I'm having the same issues.
  • Atix
    Options
    Talane wrote: »
    Any updates about this? did you manage to fix it? I'm new with animation rigging and I'm having the same issues.

    Its a bit late but you have to put tranform view inside rig targets. So animation rigging will do the job on everyclient according to rig target.