# How to add constraints to the limbs of the FBX character model driven by IK

**URL:** <https://discourse.threejs.org/t/how-to-add-constraints-to-the-limbs-of-the-fbx-character-model-driven-by-ik/61228>\
**Category:** Questions\
**Tags:** fbx, ccdiksolver, vector3\
**Created:** [February 7, 2024, 11:25pm UTC](https://discourse.threejs.org/t/how-to-add-constraints-to-the-limbs-of-the-fbx-character-model-driven-by-ik/61228 "2024-02-07T23:25:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yan\_ke](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/yan_ke/32/44632_2.png) [@yan\_ke](https://discourse.threejs.org/u/yan_ke)\
**Post date:** [February 7, 2024, 11:25pm UTC](https://discourse.threejs.org/t/how-to-add-constraints-to-the-limbs-of-the-fbx-character-model-driven-by-ik/61228/1 "2024-02-07T23:25:57Z")

</div>

I’m trying to add constraints to the limbs of my ik-driven fbx character model, hoping to prevent the model from making anti-human actions. I’m currently trying to use Vector3 to constrain the ik chain, but I don’t know how Vector3 acts on the model. I don’t know much about the constraints. The following are the constraints in my ik chain values:

```javascript
      leftLeg: {
        target: '左腿控制_L',
        effector: 'mixamorigLeftFoot',
        links: [
          {
            name: 'mixamorigLeftLeg',
            rotationMin: new THREE.Vector3(-Math.PI / 1.2, 0, 0), // 不允许向前弯曲，也不允许围绕Y轴和Z轴的旋转
            rotationMax: new THREE.Vector3(0, 0, 0) // 允许向后弯曲90度，不允许围绕Y轴和Z轴的旋转
            
          },
          {
            name: 'mixamorigLeftUpLeg',
            rotationMin: new THREE.Vector3(-Math.PI / 1.5, -Math.PI, -Math.PI), // 不允许向前弯曲，也不允许围绕Y轴和Z轴的旋转
            rotationMax: new THREE.Vector3(Math.PI / 1.7, Math.PI, -Math.PI/2) // 允许向后弯曲90度，不允许围绕Y轴和Z轴的旋转
          }
        ]
      },

```

Why do ghosts appear and keep scurrying around when the movement reaches the minimum value?

---

<div class="post-metadata">

**Author:** ![manthrax](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/manthrax/32/2596_2.png) [@manthrax](https://discourse.threejs.org/u/manthrax)\
**Post date:** [February 10, 2024, 5:01am UTC](https://discourse.threejs.org/t/how-to-add-constraints-to-the-limbs-of-the-fbx-character-model-driven-by-ik/61228/2 "2024-02-10T05:01:43Z")

</div>

Huuuuge topic and much more complicated than it sounds like you’re thinking.  
There isn’t really built in threejs support for IK and rolling your own is really complicated.  
Something along the lines of this level of complexity: [GitHub - sketchpunklabs/ossos: Webbased Character Animation System](https://github.com/sketchpunklabs/ossos)

---

<div class="post-metadata">

**Author:** ![yan\_ke](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/yan_ke/32/44632_2.png) [@yan\_ke](https://discourse.threejs.org/u/yan_ke)\
**Post date:** [February 11, 2024, 7:20am UTC](https://discourse.threejs.org/t/how-to-add-constraints-to-the-limbs-of-the-fbx-character-model-driven-by-ik/61228/3 "2024-02-11T07:20:46Z")

</div>

Thanks for your reply, it gave me an idea
