Search Unity

Question Making Unity Animation Rigging TwoBoneIK follow the animated limbs.

Discussion in 'Animation' started by UltraRobot, May 27, 2022.

  1. UltraRobot

    UltraRobot

    Joined:
    Dec 6, 2019
    Posts:
    30
    To explain the usecase. When using the HumanoidIK solution, the default position of an enabled IK leg is the pose it has in the animation. So by enabling HumanoidIK on both legs, I can for instance rotate the hips to make the character lean, while the legs keep running as in the animation. The legs won't try to do anything else unless I manually set the IK goals to something.

    I wondered if this is possible with the Animation Rigging package. By default an enabled IK chain locks the legs to the ik goals. I've tried forcing the IK targets to follow the bone positions from the animation, but in update it seems the IK has already been activated, so I'm just aligning the ik goals to ik-locked legs, not the animated positions. Is there a hook I can use to perform operations on the ik goals before they are applied to the rig? Or any other trick to be able to achieve the effect from humanoid IK, where you can do hip offsets while the IK locks the animation to the original motion.
     
  2. UltraRobot

    UltraRobot

    Joined:
    Dec 6, 2019
    Posts:
    30
    Ah. Parenting the IK goals under the foot bones seems to create the same effect as humanoidIK. I guess the animation evaluates first, moves the goal child transform, then the IK reapplies creating the same pose as before.
     
  3. UltraRobot

    UltraRobot

    Joined:
    Dec 6, 2019
    Posts:
    30
    I spoke too soon. If I constrain the hip and offset it, it will move the whole rig, which will also move the IK goals linked to the feet, which then offsets the whole animation. Still looking for a way to use IK to lock arms/legs to the original animation poses.