Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

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:
    24
    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:
    24
    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:
    24
    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.