Using SoftBody

Soft bodies (or soft-body dynamics) simulate movement, changing shape and other physical properties of deformable objects. This can for example be used to simulate cloth or to create more realistic characters.

Basic set-up

A SoftBody node is used for soft body simulations.


Create a new scene with a Spatial node as root. Then, create a Softbody node. Add a CubeMesh in the mesh property of the node in the inspector and increase the subdivision of the mesh for simulation.


Set the parameters to obtain the type of soft body you aim for. Try to keep the Simulation Precision above 5, otherwise, the soft body may collapse.




Play the scene to view the simulation.


To improve the simulation's result, increase the Simulation Precision, this will give significant improvement at the cost of performance.

Cloak simulation

Let's make a cloak in the Platformer3D demo.


You can download the Platformer3D demo on GitHub or the Asset Library.

Open the Player scene, add a SoftBody node and assign a PlaneMesh to it.

Open the PlaneMesh properties and set the size(x: 0.5 y: 1) then set Subdivide Width and Subdivide Depth to 5. Adjust the SoftBody's position. You should end up with something like this:



Subdivision generates a more tessellated mesh for better simulations.

Add a BoneAttachment node under the skeleton node and select the Neck bone to attach the cloak to the character skeleton.




To create pinned joints, select the upper vertices in the SoftBody node:


The pinned joints can be found in SoftBody's Attachments property, choose the BoneAttachment as the SpatialAttachment for each pinned joints, the pinned joints are now attached to the neck.


Last step is to avoid clipping by adding the Kinematic Body Player to Parent Collision Ignore of the SoftBody.


Play the scene and the cloak should simulate correctly.

