Game Development Reference
In-Depth Information
and Emissive Color (this is the glow color). Select a texture. In this
example, the innerWindow texture is used with the x and y tiling
values set to 10 each.
Step 5. Create a cube. If you cannot see it, with the cube selected in the
Hierarchy, select GameObject > Move to View from the main menu. The
cube will move to the center of the Scene view.
Step 6. Position the cube at the top left of the cloth. The cloth must
appear as though it is inserted into the side of the cube as shown in
Figure 2.39 . Create another cube and position it at the top right of the
cloth. Rename the cubes, ClothHook1 and ClothHook2. It doesn't matter
which one is which.
Step 7. Select the cloth in the Hierarchy and locate the Interactive Cloth
component in the Inspector. Change the size for the Attached Colliders
section to 2. Set the colliders for Element 0 to ClothHook1 and Element 1
to ClothHook2 as shown in Figure 2.39 .
Step 8. Play. Note that the cloth becomes limp and hangs from the two
cubes like a curtain. If the cloth falls to the ground or hangs from only one
cube, it will be because the cubes do not intersect with the cloth in the
corners.
Step 9. While still playing and watching in the Scene, select the cloth
and locate the Interactive Cloth component in the Inspector. To add
a blowing effect to the cloth, change the values of x , y , and z for the
External Acceleration and Random Acceleration values. External
Acceleration will add a constant fan like blowing force and Random
Acceleration will randomly add puff like breezes to the cloth. It is a
matter of playing around with these values to get the effect you
want. Remember that while you are in play mode, any of the changes
made to the cloth settings will revert when you stop. Note the
values you would like to keep to reenter them once you are out of
play mode.
Step 10. In the Hierarchy, drag and drop both ClothHook objects onto the
InteractiveCloth object to make them child objects and attach them to the
cloth.
Step 11. Press play and take your FPC through the cloth. Once inside the
truck room, turn to look back at the cloth. It will not be visible because
the normal is the other way around. The easiest way to fix this is to create
another cloth object exactly the same and flip it around to face into the
truck room.
Step 12. Right-click on the InteractiveCloth in the Hierarchy and select
Duplicate. Two cloths will now appear in the Hierarchy. Rename them
Cloth1 and Cloth2.
Step 13. Select Cloth2 and rotate it 90° such that its normal is pointing
into the room with the truck.
Step 14. Play. This time you will be able to take the FPC back and forth
between the rooms and see the cloth from both sides.
Search Nedrilad ::




Custom Search