Cloth simulation uses vertices of a mesh to simulate cloth-like behavior. The mesh needs to be dense enough to make the simulation look good. The flag used in this example has 100 vertices.
The Cloth component has a number of options to use and tweak:
- Stretching Stiffness: How stiff the cloth is when stretching.
- Bending Stiffness: How stiff the cloth is when bending.
- Use Tethers: This helps prevent unconstrained vertices going too far away from the constrained ones
- Use Gravity: This applies gravity to cloth vertices.
- Damping: This damps the motion of cloth vertices.
- External Acceleration: This is a constant acceleration of cloth vertices and can be used to simulate wind.
- Random Acceleration: This is similar to the preceding option, but is random. It is useful for simulating wind.
- World Velocity Scale: This scales the world velocity of the object to which the cloth is attached to. It is useful for a character's clothing.
- World Acceleration Scale: This scales the world acceleration of cloth vertices when the object the cloth is attached to accelerates. It is useful for a character's clothing.
- Friction: The friction to apply when cloth vertices collide with something.
- Collision Mass Scale: This scales the mass of cloth vertices when they collide with something.
- Use Continuous Collision: This is similar to the continuous collision detection of the rigid bodies and improves collision quality but is heavier on performance.
- Use Virtual Particles: This adds one virtual particle/vertex per cloth triangle and improves collision quality.
- Solver Frequency: Number of solver iterations per second.
- Sleep Threshold: The threshold after which cloth stops being simulated (sleeps).
- Capsule Colliders: An array of capsule colliders to collide with.
- Sphere Colliders: An array of sphere colliders to collide with.