I’m just stuck with this problem where I’d like to adjust the hips of the character and keep the feet planted on the ground with their original animation.
(Similar to this ^ but with walk cycles and other animations)
It feels like it’s a job for IK but I’m struggling to figure out how to do it, the best I can do so far is to completely override the foot animation with a new IK target.
I was looking at getting the character’s foot position before the IK is applied but I don’t think you can do that.
I though about creating the effect as a blend tree but there’s already lot’s going on there and this would require a whole bunch of extra lean animations.
How come you don’t think you can do that?
As far as I know the execution order would allow this information to be gathered since animation runs before IK runs, and I think you can push IK into later update stages - although as an artist I do not know this for sure.
Hey theANMATOR2b,
I went back to try and make a little repro scene and I think I got something working
I was trying to match the position in Update thinking the IK was resolved at LateUpdate but it seems like it works if you match the position in OnAnimatorIK before you set the IK position.
void OnAnimatorIK(int layerIndex){
//Match the original animation (FK)
matchObj.position = targetObj.position;
matchObj.rotation = targetObj.rotation;
//Set IK weights
avatar.SetIKPositionWeight(AvatarIKGoal.RightHand,1);
avatar.SetIKRotationWeight(AvatarIKGoal.RightHand,1);
//Set IK Position and Rotation
avatar.SetIKPosition(AvatarIKGoal.RightHand,rightHandObj.position);
avatar.SetIKRotation(AvatarIKGoal.RightHand,rightHandObj.rotation);
}