Game Development Reference
In-Depth Information
4.
Drag the Flap object into the Element 0 Collider field from the Hierarchy view.
5.
Click Play.
If the cloth is close enough to the Flap, it hangs quite nicely.
6.
Stop Play mode.
7.
Try moving the cloth farther below the Flap to see how close it must be to be
held during run time.
8.
Stop Play mode.
For the Attached colliders to work, the cloth's vertices must be within range of the colliders.
1.
Create a new Cube, and name it Hanger .
2.
Scale it down, and position it at one end of the flap.
3.
Turn off its Mesh Renderer, and drag and drop it onto the Flap in the
Hierarchy view.
4.
Duplicate it, and rename it Hanger2 .
5.
Drag the new Hanger to the other side (Figure 3-34 ).
Figure 3-34. The new Hanger objects in position
6.
Select the Cloth, and change the Attached Collider array Size to 2 .
7.
Drag the two Hangers into the two elements.
 
Search WWH ::




Custom Search