O'Reilly logo

Unity 4 Game Development HOTSHOT by Jate Wittayabundit

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

Creating a rockslide and trigger area

In the previous section, we created the destructible wall object, which contains four cubes. Each one has the Rigidbody and Box Collider components attached, which will make the wall such that we are able to shoot and break it. In this section, we will create a rockslide that will be triggered when the player hits the trigger area, which will have the script attached later in the next step.

Prepare for lift off

We will begin with creating an empty object for our rockslide:

  1. Let's go to GameObject | Create Empty to create the empty game object and name it Rockslide. Reset its position to X: 0, Y: 0, and Z: 0.
  2. Then, we will create another empty game object by going to GameObject | Create Empty and name it Break

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