Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Bug New rigging system : Twist correction issue

Discussion in 'Animation' started by Xahell, Jul 28, 2023.

  1. Xahell

    Xahell

    Joined:
    Dec 2, 2017
    Posts:
    7
    Hello! I got an issue with what should be a simple hand IK. I have:
    • Two bones IK constraint (hand -> elbow -> shoulder)
    • Twist correction (copy hand rotation on twist bones, 66% and 33% weights, not parented to the hand)
    It's from a Maya rig, so it's using the X axis for the rotation.

    The issue: The two bones IK constraint provides a quaternion on the hand that sometimes reverses the solution. No visual impact, AFAIK it's just how quaternion are, so the X rotation jumps from < -170 to > 170, but the transform gizmo remains the same.

    What's problematic is that the twist correction messes up when that changes occurs. Here are two screenshots showcasing the issue.

    upload_2023-7-28_13-37-32.png

    Here the hands rotation moved just a little bit, and the x rotation is now positive (x = 177). Notice how the twist correction glitches and we now have an incorrect solution.

    upload_2023-7-28_13-38-2.png

    This only happens when there are 2 or more nodes in the twist correction. If the twist correction works with a single node, then it works fine (except that it looks ugly and is therefore not an acceptable solution).

    All bones use the same orientation (forward = x, up = -y).

    Thanks for the help!
     
  2. Xahell

    Xahell

    Joined:
    Dec 2, 2017
    Posts:
    7
    OK so I figured out a more precise explaination for this issue.

    The twist correction works correctly when rotating the wrist to the right, but it doesn't work when rotating to the left.

    The other consequences being that when the correction switch from right to left because you turned your wrist 180°, it goes from "OK" to "bad" instantly.

    So the actual problem is that the twist correction does nothing relevant when rotating specifically to the left.
     
    Last edited: Jul 29, 2023
  3. Xahell

    Xahell

    Joined:
    Dec 2, 2017
    Posts:
    7
    (couldn't add those images to the post above, in edit you can't add new image it seems)
     

    Attached Files: