In this lesson, you will learn how to build a functional ragdoll system by mapping collision primitives to skeletal bones and defining the movement limits of your character’s joints.
The Foundation: Physics Bodies
When you import a skeletal mesh, it is purely visual. To make it interact with the world, we use the Physics Asset Editor. You represent each bone (like the upper arm or thigh) with a "Physics Body"—essentially a simplified 3D shape like a capsule, sphere, or box.
The goal here is "approximation." You don’t need the physics shape to perfectly match the mesh; in fact, simpler shapes perform better. If you make your collision primitives too complex, you’ll trigger constant jitter or collision overlaps that crash your simulation. Always aim for a "snug fit" that avoids overlapping with neighboring bones.
Enabling Articulation with Constraints
Once your bodies are in place, you must tell Unreal how they relate to each other. This is handled by Constraints, which act as the "hinges" or "sockets" between your bodies.
A constraint has a Pivot Point (the axis of rotation) and Angular Limits. If you look at an elbow constraint, you would set a Swing1 and Twist limit to prevent the arm from bending backward. In the details panel for your constraint, you’ll see settings like:
- Angular Limits: Defines how far the bone can rotate (in degrees).
- Linear Limits: Usually kept at
Lockedfor characters to keep the skeleton from pulling apart during movement.
Setting Up a Hinge
To constrain a knee or elbow, you configure the pivot using the Constraint Editor viewport:
- Select the constraint node between the two bodies.
- Use the Rotate tool to align the constraint’s local axis (the colored rings) with the joint’s natural hinge axis.
- Toggle the Show Limits view in the viewport to visualize your defined rotation arcs in real-time.
By carefully tuning these pivots, you ensure that when the character goes limp, the limbs move realistically rather than folding like a broken doll.
Key Takeaway: Physics Assets bridge the gap between visuals and simulation by wrapping bones in lightweight primitive shapes and connecting them with rotational hinges that define the limits of human movement.