P
P
p4p2019-05-12 06:24:59
Unity
p4p, 2019-05-12 06:24:59

Why doesn't IK of arms work if the target object is a child of character bones?

I try to keep the character's hands on the weapon:

animator.SetLookAtWeight(1, 1, 0.5f, 0);
                    animator.SetLookAtPosition(Application.instance.characterLookAtPoint.position);

                    if (leftHandPos != null && rightHandPos != null)
                    {

                        animator.SetIKPositionWeight(AvatarIKGoal.LeftHand, 1);
                        animator.SetIKRotationWeight(AvatarIKGoal.LeftHand, 1);
                        animator.SetIKPosition(AvatarIKGoal.LeftHand, leftHandPos.position);
                        animator.SetIKRotation(AvatarIKGoal.LeftHand, leftHandPos.rotation);
                        

                        animator.SetIKPositionWeight(AvatarIKGoal.RightHand, 1);
                        animator.SetIKRotationWeight(AvatarIKGoal.RightHand, 1);
                        animator.SetIKPosition(AvatarIKGoal.RightHand, rightHandPos.position);
                        animator.SetIKRotation(AvatarIKGoal.RightHand, rightHandPos.rotation);
                        
                    }

everything would be fine, but if the weapon becomes a child of the skeleton, then the hands stop moving.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question