O'Reilly logo

Unity 3D Game Development by Example by Ryan Henson Creighton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - collision-enable the Character

Now that the bomb is all rigged up, we'll be able to determine through code when it hits the player character. However, the player character is missing its Collider Component too! Let's fix that.

  1. Click to select the Character Prefab in the Hierarchy panel.
  2. Click Component | Physics | Box Collider in the menu. You'll see that "Losing prefab" warning. Don't fret none just click on Add.
  3. In the Inspector panel, click on the gray arrows to expand the Size and Center settings for your new Box Collider. Update the fields with these values:
    • Size: 5, 16, 10
    • Center: -1, 8, 1
Time for action - collision-enable the Character

Just like we did with the bomb, we'll ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required