Did you ever want to learn how to use cloth simulations in Unreal Engine 5?
In part three of this tutorial series, I will show you how to quickly get started using chaos cloth simulations in UE5.
Basic Cloth Simulation
This was a requested tutorial
Just be aware that I am working in 5.1.1 because I could not get the cloth simulation to completely work in 5.2.1
Let’s start with the basic cloth simulation
Start in Blender (or a 3D package of your choice)
Add a plane and scale it up
In edit mode, right-click on the plane and subdivide it [36]
We need a bunch of geometry so the plane with be able to bend and form like real cloth
In object mode, use CTRL + A to apply the scale
Export the plane as an FBX – make sure you have “Selected Only” activated
Under the Geometry section, change the Smoothing to “Face”
In Unreal, add a new folder for your cloth
In the cloth folder, right-click and import the plane
Click on the “Reset to Default” button so we can ensure everything will be imported properly
Make sure you make a Skeletal Mesh
Click on “Import All” – ignoring the warnings
Save the project
Double-click to open the Skeletal Mesh
Right-click on the plane and choose “Create Clothing Data from Section”
Then make sure the correct Physics Asset is selected
Click on “Create”
Next, click on “Activate Cloth Paint”
Select the plane under the Clothing Data
The pink color indicates areas where the cloth will remain static
We have a Paint Value in the Clothing tab – the higher the value the more the painting process will affect the plane
We can also change the Brush Radius, Strength, and Falloff
If we use the LMB and paint on the plane, notice that the painted area becomes white – this is where the simulation will take place
I will leave a thin area at the top pink so it will essentially be pinned in the Level at those points
When you are done painting, click on “Deactivate Cloth Paint”
Right-click on the plane and choose “Apply Clothing Data” – selecting the plane object
Make sure “Max Distance” is checked under the Masks panel – otherwise, the cloth will just fall continuously
Save the cloth simulation
Drag the Skeletal Mesh into the Level and move it up along the Z-Axis and rotate it around the Y-Axis
Select the cloth and in the Details panel, activate “Collide with Environment” and “Force Collision Update”
These options will tell Unreal that you want the plane to collide with objects in the environment
Click on the three dots to the right of the play button and choose “Simulate”
Now we can see the plane reacting to the environment
To add a wind effect, under the Add to Project menu, under “All Classes”, search for “Wind Directional Force”
Drag it into place and make sure the light blue arrow is facing the correct direction
In the Details panel, increase the speed
Save the Level
Play the Simulation
Character Cloth Simulation
I will be using a character and animation I downloaded from Mixamo
When I import the character into the Level, notice that the loincloth does not move naturally as the character animates
To fix this issue, I open the Skeletal Mesh for the character
Right-click on the loincloth and choose “Create Clothing Data from Section”
Then make sure the correct Physics Asset is selected
Click on “Create”
Next, click on “Activate Cloth Paint”
Select the loincloth under the Clothing Data
Use the LMB and paint on the loincloth – leaving some areas pink toward the top of the loincloth
When you are done painting, click on “Deactivate Cloth Paint”
Right-click on the loincloth and choose “Apply Clothing Data” – selecting the correct object
Make sure “Max Distance” is checked under the Masks panel
Save the cloth simulation
To avoid the problem of the loincloth clipping through the character mesh, we need to work on the Physics Asset
Double-click on the Physics Asset for the character to open it up
Notice the capsules surrounding the character – these are the collision shapes
If you see clipping on your animated character, I recommend scaling them until they are barely interacting with the clothing
We don’t have that issue with this character though so I can leave the collisions as they are
Drag the Animation Mesh into the Level
Now, if we press the play button, we can see the loincloth reacting go the animation
If the cloth is still not acting correctly, you can always follow the previous steps to refine the cloth simulation