Game Development Reference
In-Depth Information
Figure 16.7 The door that will be locked.
Step 14: Rotate the group so that the door is shut. The Rotation XYZ
should all be 0 .
Step 15: Make sure the group (and its children) is set to non-Static. Do this
in the Inspector by checking off the Static option.
Why?
The group was probably originally set to Static since it needs to be to
be included in the bake. However, if it remains marked as Static we
can't animate it with iTween (or any other script-driven method for that
matter).
Step 16: Create a trigger called Trigger-LockedDoor. As a refresher,
remember this can be done by creating a Cube (GameObject>Create
Other Cube). Click off its Mesh Renderer in the Inspector. Turn on its Is
Trigger option within the Box Collider and resize and place it as seen in
Figure 16.8 .
Figure 16.8 Trigger-LockedDoor.
Step 17: Create an AudioSource that contains the sound of a squeaky
door opening. Make sure Play on Awake is turned off. Place the
AudioSource right by the door and name it Sound-DoorLocked.
Search WWH ::




Custom Search