Fine-tuning the Capsule Collider

Capsule Colliders have the shape of a pill—that is, a cylinder with rounded ends. We can view the Capsule Collider by selecting our character in the Hierarchy panel or the Scene view and then reviewing the Capsule Collider component in the Inspector panel. As shown in the following screenshot, we can edit the Capsule Collider by clicking the Edit Collider button:

Here is a brief description of each of the Capsule Collider component parameters:

  • Is Trigger: When we enable this option, the physics engine will ignore the Capsule Collider
  • Material: We can assign how the Capsule Collider interacts with other colliding game objects
  • Center: There are X, Y, and Z fields to identify the center of the capsule relative to itself
  • Radius: The radius of the collider's width
  • Height: The collider's height
  • Direction: The orientation of the capsule lengthwise

For greater precision, the Capsule Collider should receive a height adjustment so that the Cucumber Man fits within it, as shown in the following screenshot:

Make any refinements required to ensure that your Cucumber Man's Capsule Collider resembles the preceding screenshot. Once you complete your refinements, be sure to save your work.

All changes to the Cucumber Man game detailed in this chapter will be incorporated in the Starting-Chapter-08.zip file available at the beginning of Chapter 8, Implementing Our Non-Player Characters
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset