Cloth Simulation in Unity

Cloth Component

Add a Cloth component to the GameObject that hosts the mesh renderer you want to make “clothy”. It will automatically swap out the mesh renderer for a Skinned Mesh Renderer. At that point the plumbing should all be there. Use the constraints tool to edit the nodes in the mesh (there will be a node for every vertex).

You also need to add the colliders of the GameObject instances that you expect to be able to collide with the Cloth. These live in an array of ClothSphereColliderPair objects (there’s also an array of capsule-type colliders) that you need to set ahead of time, or update via a script if the objects change at runtime.

unity c_sharp physics