Course contentsShow
← Unreal Engine Game Development
Lesson 250 of 8804. Advanced Input and PhysicsFree lesson

Simulating Realistic Cloth and Soft Body Dynamics

Learners will apply Chaos cloth simulation to skeletal meshes to achieve realistic fabric movement and deformation in response to character motion.

In this lesson, you will learn how to leverage the Chaos physics engine to apply realistic, motion-reactive cloth simulations to your character’s skeletal meshes.

Understanding Chaos Cloth Simulation

Until now, we have handled physical interactions primarily through rigid bodies and constraints. However, fabric—like capes, skirts, or banners—requires a different approach because it must deform continuously based on the character's movement. In Unreal Engine, we achieve this using Chaos Cloth, which transforms parts of a skeletal mesh into a dynamic simulation.

Unlike a rigid body that maintains its shape, cloth simulation uses a mesh of interconnected particles connected by constraints. These particles react to gravity, wind, and the skeletal animation of the character (e.g., the way a coat swings when a character runs).

Implementing Cloth on Skeletal Meshes

To apply this, you first designate a portion of your Skeletal Mesh as cloth using a Cloth Asset. This is essentially a skin weight-based system where you "paint" the areas of the mesh that should be simulated:

  1. Selection: In the Skeletal Mesh Editor, you select the vertices of the garment.
  2. Creation: You create a new Chaos Cloth asset. This asset acts as a container for physical properties like Stiffness, Damping, and Friction.
  3. Simulation: Once assigned, the Chaos Solver takes over these vertices. It calculates the delta between where the bones move the mesh and where the physics simulation wants the fabric to settle.

You can influence this simulation using a Chaos Cloth Config object. For example, to make a heavy cloak move less than a thin silk scarf, you would adjust the Bending Stiffness and Mass Multiplier within the cloth configuration asset:

// Conceptual view of adjusting simulation parameters
ClothConfig.BendingStiffness = 0.5f;
ClothConfig.GravityScale = 1.0f;
ClothConfig.DampingCoefficient = 0.1f;

By balancing these settings, the mesh will move fluidly with your character's skeletal animations rather than clipping through their body or appearing static. Remember that because this is a simulation, complex meshes can be performance-heavy, so it is best to simulate only the essential moving parts of an outfit.

Key Takeaway: Chaos Cloth transforms static skeletal mesh vertices into a dynamic, particle-based simulation that calculates deformation in real-time, allowing fabric to react naturally to skeletal motion and external forces.