Game Development Reference
In-Depth Information
Unity Hands On
Flying the Flag
In this workshop you will learn how to add wind effects with the Unity
physics system.
Step 1. Create a new Unity Project. Add a cube and resize to the
shape of a long flagpole.
Step 2. Add a Cloth by selecting GameObject > Create Other > Cloth.
Rotate the cloth and resize to fit at the top of the flagpole. Add a
texture to the cloth. One side of the cloth should be embedded
in the flagpole cube as shown in Figure 7.40 .
FIG 7.40 Creating a flagpole and flag.
Step 3. Select the Cloth in the Hierarchy and locate the Interactive
Cloth component. Set the Size of the Attached Colliders to 1 and drag
and drop the cube object (which is the flagpole) onto the Collider
value (see Figure 7.40 ).
Step 4. Set the Interactive Cloth component's value for External
Acceleration and Random Acceleration to a vector parallel with the
flag. In the given example, in Figure 7.40 , this is ( - 10,0,0).
Search Nedrilad ::




Custom Search