Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Humanoid Rig - Clamp/Limit Bone Rotation

Discussion in 'Scripting' started by CyberArtist, Nov 2, 2021.

  1. CyberArtist

    CyberArtist

    Joined:
    May 31, 2014
    Posts:
    25
    I'm currently working on a humanoid rig for motion capture. The rig currently uses Unity's Rotation Constraint component to freeze the rotation axis of certain joints. However, I also want to limit how far certain bones rotate on certain axis. What I am looking for is a solution that behaves like the Rotation Constraint component, yet it limits rather that freezes rotations on the x, y, and z axis.

    How should I write a script to achieve this result? I'm using Unity 2019.4.16f.