Search Unity

Question Twist Correction not working as "advertised"? Rotation isn't redistributed, it's added

Discussion in 'Animation Rigging' started by dgoyette, Jul 9, 2023.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,196
    I've set up a Twist Correction on the head bone of a humanoid model, in order to give some shoulder motion when the head rotates:

    upload_2023-7-9_22-39-5.png

    This does produce a nice rotation in the shoulders and neck when the head rotates. However, the end result is that the head rotates a lot further than normal when this correction is used. Here's the model with no twist correction:

    upload_2023-7-9_22-40-54.png

    And here's the same frame of the Animation Clip with Twist Correction enabled:

    upload_2023-7-9_22-41-53.png

    You can see he's looking much further to the left than he originally was.

    I say this isn't working as "advertised" because that's not how the example in the docs describe it:

    https://docs.unity3d.com/Packages/c...g@1.1/manual/constraints/TwistCorrection.html

    Just looking at the GIF on that page, showing the hand rotating, the hand's rotation in all three examples is identical, regardless of whether the twist is being applied. What this indicates is that when Twist Correction is used, it should "consume" some of the rotation being applied to the source object, to ensure that it's final world-space orientation is the same as it would be without the twist. But that doesn't seem to be happening.

    Do I just have something misconfigured? Or does Twist Correction not work this way? It seems really messy if adding Twist Correction breaks animations where the character was looking at a certain place. Now, they'll be looking somewhere else... The documentation states that the rotation is redistributed, but so far it seems like it just adds a portion of the rotation without deducting it from the head's rotation. I should mention that this is a Humanoid rig.

    I can get something kind of correct if I rotate the shoulders with a positive Twist value, and assign negative twist values to the two neck bones to offset it. That causes the head to end up in the same rotation it would without any constraint. But that's not how the example is shown.

    Thanks.
     
  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,196
    Any thoughts on this? Is this a bug I need to report? Or is this feature not intended to produce the same final rotation of the tail as it would without the Twist enabled?

    I just don't see how this feature can really work in its current state without producing really weird results. For example, imagine an animation has a character turn their head as far to the right as possible. Now if you add a Twist constraint, the head will rotate almost 180' around, since the rotation added to the neck and shoulder bones isn't deducted from the head's original local rotation.

    Or am I just not setting it up correctly?