Game Development Reference
In-Depth Information
Figure 3-13. The BigTree's components in the Inspector
As you can see, there is no collider component of any type. When Colliders are added to
gameObjects, they are scaled according to the object's bounding box. For a tree, you will want to
adjust the collider's size to fit the trunk. The easiest way to do the adjustment is to do it in the Scene
view. Let's begin by adding a collider component. Besides the Component menu, you can add
components using the Add Component button at the bottom of the current components. Unlike you
did in its menu counterpart, you will have to click to open the submenus.
7.
Drag the BigTree prefab into the scene.
8.
Click the Add Component button just below the Mesh Renderer component.
9.
Click to open the Physics submenu, and select Capsule collider.
The Capsule collider is scaled to fit around the entire tree (Figure 3-14 ).
Search WWH ::




Custom Search