Using cloth
In this recipe, we will create a simple cloth simulation:

Cloth simulation used to create a flag
Getting ready
For this recipe, we need a model of the cloth. It should be a plane divided several times to have enough vertices for the cloth simulation to work. In our example, we use one additional model: the flag pole. You can go to the Chapter 09 Physics and animations\Recipe 01 Using cloth directory. You will find a FlagPole game object in the Example.unity scene there. This object contains the Flag and the FlagPole objects as children. The Flag game object uses the cloth simulation.
How to do it...
To use cloth simulation, follow these steps:
- Place the
Flaggame object in the scene. - Add the
Clothcomponent to theFlaggame object (go toComponent|Physics|Cloth).
- Notice that a
Skinned Mesh Renderercomponent is automatically added. You may remove theMesh Renderercomponent from the object. - Find the mesh of the
Flagand drag it to theMeshfield in theSkinned Mesh Renderercomponent...