Photon and animation rigging

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Photon and animation rigging

Atix
2020-11-07 14:04:18

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:

[

](https://hizliresim.com/WDoc4F)

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
2021-03-18 07:42:26

Any updates about this? did you manage to fix it? I'm new with animation rigging and I'm having the same issues.

Atix
2021-08-10 01:17:08

@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.

Back to top