In the last section we created the destructible wall object, which contains four cubes, each with the Rigidbody and Box Collider attached to it, and we can shoot to break it.
In this last section, we will create the rockslide that the rock will fall on when the player hits the trigger area and creates the
TriggerArea script to enable and disable the
Go to GameObject | Create Empty to create the empty game object and name it
Rockslide and reset its position to X: 0, Y: 0, Z: 0.
Then, create another empty game object by going to GameObject | Create Empty; name it
Break and drag it inside the
Rockslide, as shown in the following screenshot:
Next, create two cube objects, ...