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

Multi-Aim Constraint limits don't work

Discussion in 'Animation Rigging' started by AMNOD, Dec 19, 2019.

  1. AMNOD

    AMNOD

    Joined:
    Oct 19, 2014
    Posts:
    13
    I've been playing with the ninja sample to get a better understanding of the Animation Rigging package. First of all, I would like to thank you, I like the package a lot.
    Secondly I have a couple of questions concerning the Multi-Aim Constraint:
    1-Shouldn't there be limits for each axis depending on "Constrained Axes" ?
    2-I faced the following issue regarding the limits:
    I tried dragging the target behind the character which resulted in the artifact below so I exited play mode and played with the limits of the Spine Constraint (Right Inspector) but they don't seem to work on the Spine Ctrl (Left Inspector). Am I missing sth ?

    upload_2019-12-19_6-16-54.png
     
  2. AMNOD

    AMNOD

    Joined:
    Oct 19, 2014
    Posts:
    13
    Ohh, I checked the code to find that the "Limits" apply to the rotation delta not clamping the final rotation value. I guess I got confused there..

    Code (CSharp):
    1. var rotToSource = Quaternion.AngleAxis(
    2.                         Mathf.Clamp(Vector3.Angle(currentDir, toDir), minMaxAngles.x, minMaxAngles.y),
    3.                         Vector3.Cross(currentDir, toDir).normalized
    4.                         );