Search Unity

I am making a rig-based FPS character and have a problem animating an Animation Rigging IK bone

Discussion in 'Animation' started by Arisaka0953, Sep 10, 2022.

  1. Arisaka0953

    Arisaka0953

    Joined:
    May 23, 2020
    Posts:
    3
    So I am making an FPS character with a character model, and I am applying Animation Rigging IK for the leg. It is a typical 2-bone IK Constraint leg with a hint object and a target object, one located in front of the knee and the latter behind the foot. It works fine. The problem is when I rotated the entire character in the Y axis with mouse via script, it slightly deviates the position of the foot while an animation is running.
    This is the how i do the rotation :
    Code (CSharp):
    1. transform.Rotate(Vector3.up * mouseX);
    2. #mouseX is the mouse input value

    This picture above is the character, with an idle animation running. I then rotate the character around 90 degrees left and the leg deviates like this :

    its as if the foot ik has a completely different pivot point than the parent objects. How do I mitigate this so the foots always align and that it rotates properly?
     
  2. makaolachsiungca

    makaolachsiungca

    Joined:
    Sep 27, 2019
    Posts:
    31
  3. Arisaka0953

    Arisaka0953

    Joined:
    May 23, 2020
    Posts:
    3
    I rotated the whole character
     
  4. makaolachsiungca

    makaolachsiungca

    Joined:
    Sep 27, 2019
    Posts:
    31
    It looks like ik target(under twoBoneIK rig) control by other script,
    make sure to update the ik target position or set the weight to zero while ik control script been disable.
     
  5. Arisaka0953

    Arisaka0953

    Joined:
    May 23, 2020
    Posts:
    3
    Thanks for the help, it turns out the rotations worked a bit differently depending on the position of the hint and and the target, its fixed