# How to make a waving flag

1. Create a Tube at the origin.

2. Give it `40` Rows, `10` Columns, and turn on the End Caps checkbox.

3. Dive down to the geometry level and attach a Transform node.

4. Move the Centre of the tube up by `5` in the Y-axis, and scale it by `0.1`, `6`, `0.1` respectively in each axis.

5. Go back up to the geometry level and create a Grid. Make its size 2 by 1, give it 33 rows and 65 columns, and orient it to the YZ plane.

6. Put down a Transform node and position the grid so it lines up with your tube like a flag on a pole (`0`, `5.4`, `-1.1`). Make sure that it doesn’t intersect the geometry of the pole in any way, because this causes problems with the solver. In general, geometry being used for cloth should never intersect itself initially, or any thing that it is meant to be colliding with.

7. Use the Cloth Object shelf tool to turn the grid into a cloth object.

8. Use the Rigid Collider shelf tool to turn the pole into a non-deforming, volume-based collider. In the AutoDopNetwork, increase Uniform Divisions to 200 on the Static Object.

9. Click the Attach to Body shelf tool. Select the grid as the cloth object you want to constrain and press Enter. Then select the top and bottom corners of the grid as the points to constrain to the pole and press Enter. The cloth will automatically be constrained to the closest points on the pole.

10. Change the Constraint Type to Hard so that the flag stays firmly stuck to the pole at the constraint points.

11. Use the parameters on the Drag tab of the Cloth Object to create a Wind Force that affects the flag. Set the z-component of the External Velocity Offset to `-25`.

12. Press play on the Playbar to view the simulation.