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?
lengmc
October 16, 2019, 9:27am
2
Hi, did you find a solution? Iām facing exactly the same problem
1 Like
lengmc
October 16, 2019, 9:35am
3
PhilippG:
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?
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);
lengmc
October 17, 2019, 8:27am
4
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.
PhilippG:
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?
Hello! I am facing the same issue. Did you fix that? Thanks!!