Players Own Animation Rig Weight Does not Update on other players screens

Hi there.

Question about Netcode for Game Objects and animation rigging. I have a Rig with a two bone IK constraint and I want to control it through the weight. I have tried altering this through a network variable and also RPC’s

I also have client network transforms on my characters and other parts.

Still through these methods the weight/ IK animation only updates on the players character but other characters do not update.

Would anybody possibly know why?

Thanks in advance !

    NetworkVariable<int> IKRigWeight = new(0, NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Owner);

    void Start()
    {
       
        if (IsOwner)
        {
            animator = GetComponent<Animator>();

            IKRigWeight.OnValueChanged += (oldVal, newVal) =>
            {
                R_HandIK.weight = newVal;
            };

       }
}

    void Update()
    {
        if (IsOwner)
        {
              if (Input.GetKeyDown(KeyCode.I))
            {
                IKRigWeight.Value = R_HandIK.weight == 0 ? 1 : 0;
            }
        }
}

Incase anyone else faces this problem I have found the solution through changing the IsOwner Boolean

    NetworkVariable<int> IKRigWeight = new(0, NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Owner);
    void Start()
    {
      
            IKRigWeight.OnValueChanged += (oldVal, newVal) =>
            {
                R_HandIK.weight = newVal;
            };
            if (!IsOwner) return;
        
            animator = GetComponent<Animator>();         
   }
    void Update()
    {
        if (!IsOwner) return;
     
        if (Input.GetKeyDown(KeyCode.I))
        {
            IKRigWeight.Value = R_HandIK.weight == 0 ? 1 : 0;
        }
    }
}
1 Like