Animator.SetBoneLocalRotation - clarification needed

Hello!

I need some advice/clarification concerning Animator.SetBoneLocalRotation.

I am adding a offset on the localrotation of the Upperarms on IKCallback,
like so:
rArm = Animator.GetBoneTransform(HumanBodyBones.RightUpperArm);
Animator.SetBoneLocalRotation(HumanBodyBones.RightUpperArm, offset * rArm.localRotation);

Now I figured that even without the offset, as soon as I call:
Animator.SetBoneLocalRotation(HumanBodyBones.RightUpperArm, rArm.localRotation);
the rotation does change a few degrees.

Thats a problem because that is messing up some animations that rely on the arms rotations to be exact.
If I just stop calling SetBoneLocalRotation the arm snaps into the right position, but I need to have it blend seamlessly.

My question is:
What parameter would I need so the rotation is not changed at all?
Or when/on which layer, if it is a timing issue?

Hi, did you find a solution? I’m facing exactly the same problem :frowning:

1 Like

I tried to set UpperArm&LowerArm&Hand at the same time and it looks better but still have a slightly different rotation.

animator.SetBoneLocalRotation(HumanBodyBones.LeftUpperArm, animator.GetBoneTransform(HumanBodyBones.LeftUpperArm).localRotation);

animator.SetBoneLocalRotation(HumanBodyBones.LeftLowerArm, animator.GetBoneTransform(HumanBodyBones.LeftLowerArm).localRotation);

animator.SetBoneLocalRotation(HumanBodyBones.LeftHand, animator.GetBoneTransform(HumanBodyBones.LeftHand).localRotation);

For those are facing this, I achieved my goal by using this instead:

void LateUpdate()
{
animator.GetBoneTransform(HumanBodyBones.LeftHand).localRotation *= someOffsetQuaternion;
}

When offsetQuaternion is totally 0, the LeftHand will stay perfectly where it should be.

Hello! I am facing the same issue. Did you fix that? Thanks!!