Can't get IK working how I want for ragdoll

Hey so I’m trying to get IK to work for my active ragdoll so I can pick up an object in my game.

I’ve made the active ragdoll by having an Animated and Physical copy of my Armature, where the bone game object’s in the Physical copy have colliders, rigidbodies, configurable joints and a Copy Motion script which copies the target rotation’s of the limbs in the Animated copy so I can play animations for my ragdoll. This all works fine and this is the hierarchy.

I followed this video to implement IK to my left and right hand so the goal is when my player is holding an object the hands stay “stuck” to where they are holding the object, so it actually looks like my player is holding the object.

I added a Rig Transform component to my object and Right and Left Hand Target child game object’s which are referenced in my Two Bone Ik Constraint’s, and this sort of works. But because of the nature of my physical ragdoll, there are points where the hands aren’t holding the object and there is a clear gap between the hands and the object.


Increasing the mass scale on the Hips, Lower Chest & Upper Chest while holding something gives a little better results, but it feels like putting a plaster on the problem, as it still has the same effect.

I don’t know if this is relevant but when the player picks up the object this is the code I put in Update to have it update position and rotation to be held (when attached to player it’s really jerky which is why I did it this way which looks much better):

{
  if (bAttachedToPlayer)
  {
    // get the player's Y rotation
    playerYRotation = Quaternion.Euler(0, playerTransform.eulerAngles.y, 0);

    // update position relative to the player's Y rotation
    transform.position = playerTransform.position + playerYRotation * grabLocation;

    // update rotation to match the player's rotation
    transform.rotation = playerYRotation * Quaternion.Euler(grabRotation);
  }
}

I just want a way to “stick” the hands to the same position on the object, while having my active ragdoll physics still. Like grabbing an object in Human Fall Flat for example, which I know uses IK.

Please can someone help me fix this, thank you.

Heres the most on point explanation and usage of IK https://youtu.be/SU2D0EO6Ctw I think what you are trying to achieve is this behavior https://youtu.be/CMbptYr-Cx4?si=OexvVfrB13XKZJ0h&t=82
Hope it helps!

1 Like