Photon PUN 2 and Animation Rigging

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:

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.

Any help and idea would be great! Thank alot.

I don’t understand how you go animation rigging working at all with PUN. I havn’t had much luck, but i just started trying this week.

Is there any good documentation for it?

I cant seem to find documentation but try reading the youtube videos comments. You just have to apply photon transform view inside the viewobject.

Can Anyone tell How to call Animation Rigging on network. Because I am new And I don’t know how to do this.

I got it add photon transform view to child of any animation rigged component object and add photon view and photon transform view to source object of that rigged component. It will work.

1 Like

Hello, did you ever get this issue solved? I am having the exact same issue now, thanks!

no need for extra stream syncing code stuff, just have transform view on all rigged objects and source objects, with a photon view also on the source obj (ie. camera has trans view and photon view, spine just has trans view
)

same issue here… you can test my game with the issue here: OverPath by InfamousCode