Game Development Reference
In-Depth Information
1.
Select the Capsule, and check out its Capsule Collider component in the
Inspector (Figure 2-14 ).
Figure 2-14. The Capsule Collider component
2.
Disable the Capsule's Mesh Renderer to get a better look at its Capsule
Collider in the scene view.
3.
Select the Sphere in the Hierarchy view, and Activate it by clicking the check
box at the top of the Inspector to activate it.
4.
Disable its Mesh Renderer to get a better view of its Sphere Collider.
In addition to having the option to act as a trigger only, colliders of any shape can use a Physic
Material to define how they react on collision. The Physics Material lets you set bounciness and
other physics-related properties. You will be experimenting with physics in the next chapter.
Common to the collider shapes based on primitives is a set of adjustments for the shape itself,
including the X, Y, and Z adjustments for its center offset. Mesh colliders can be used when the
shape requires more accurate collision testing, but it is far more efficient to use one of the other
shapes and adjust it to fit. Colliders are a mainstay of Unity that you will be seeing a lot more of.
Mesh Filter
The Mesh Filter component is what holds the 3D mesh for the gameObject. You will rarely need to
do anything with it, but occasionally the actual mesh will go missing, so it is worth a quick look.
1.
Select the Capsule object.
2.
Click the little circular browse icon to the far right of the Mesh parameter's
loaded Capsule mesh.
When the Browse window appears, you will see a few imported meshes at the top and several
internally generated primitives that Unity includes for its own use. The Capsule is currently selected,
and information about the mesh is shown at the bottom of the Browse window. The Browse window,
just as with the second column of the Project view, has a scaling slider that allows you to adjust the
 
Search WWH ::




Custom Search