How’s it going my 640 Laboratorians!

This article is an exciting one for sure, as the title reads, we will be going over how to target animations/rotations using Configurable-Joints.

Let’s start with an instructional gif:

Double-Click to Enlarge

To add context to the gif, the basic setup is this; create two empty game objects, one named ragdoll the other named target. Within those empty game objects create two capsules named top and bottom and place them so respectively.

Add a Configurable-Joint -only- to the top game object for the ragdoll. Set the anchor to where the top & bottom meet, in the video the anchor is set to -0.75. Then set its axis to -1, as done in the gif. Next, set the XYZ Motion to Locked and the XYZ Angular Motion to Free. (Uncheck enable preprocessing for better stability).

Then within the rigidbody component, enable isKinematic for the ragdoll’s top. This will prevent it from falling down, for now that is what we want so that we can test the scene.

Last, we add the JointFollowAnimRot.cs to the ragdoll’s top. Set the target variable to bottom of the target game object.

Save & Run scene, now when you rotate bottom of the target game object the bottom of the ragdoll game object will attempt to match its rotation while still obey the constraints set in the Configurable Joint settings.

All done!

Here’s an example of what you can do with the information provided through this tutorial! Project-Source available on our ko-fi page.

Playable Demo