Game Development Reference
In-Depth Information
the NPCs (non-player characters) to land and move around on the visible mesh surfaces. The player
will get to shoot projectiles around the garden that shouldn't be able to go through walls, so you can
use Box colliders on those.
1.
Select the Raised Bed in the Hierarchy view, and from the Components,
Physics menu, add a Mesh Collider.
2.
Repeat step 1 for the Planter Tower.
3.
Select the Gate Wall, and add a Box Collider to it.
4.
Repeat for the Wall, Pillar Corner, and all four walkway objects.
The Gateway is a special case. Obviously, the character tasked with eradicating the vermin will have
to come through the doorway, but the mesh itself is too complicated to waste a mesh collider on if
you consider that most of the tris are up in the roof area. For that object, you will use two simple box
colliders. Using multiple, simple colliders is a common and efficient solution in many cases.
5.
Select the Gateway.
6.
Add a Box Collider to it.
You could change its values in the Inspector until you got a custom fit, but you can use a shortcut
key to speed up the process.
7.
Hold the Shift key down.
Grips appear on the sides of the collider—they're green, to match the collider's wire color
(Figure 4-27 ).
Figure 4-27. Grips appearing on the collider when the Shift key is pressed
 
Search WWH ::




Custom Search