Detecting collisions of Cucumber Man and cherry trees

In this section, we will enable and test collisions between the Cucumber Man and cherry trees. Our first step is to ensure the cherry trees in our sandbox area all have the CherryTree tag. We previously created the tag name, so we only need to apply it to the trees in our sandbox. Here are the steps:

  1. In the Hierarchy panel, select a Cherry Tree that is inside your sandbox area
  2. In the Inspector panel, click the drop-down box to the left of the Tag label
  3. Select the CherryTree tag
  4. Repeat steps 1 through 3 for each Cherry Tree GameObject in your sandbox area
  5. Optionally, repeat steps 1 through 3 for all the Cherry Tree GameObjects in the Hierarchy view, not just the ones in your sandbox area ...

Get Getting Started with Unity 2018 - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.