Time for action – tagging the tray

Save and close the HeartBounce script—we'll come back to it in a jiffy. First, let's tag the tray GameObject so that we can determine if the heart has collided with it.

  1. Click on the HandsAndTray GameObject in the Hierarchy panel.
  2. In the Inspector panel, just beneath the GameObject's name, is a dropdown labeled Tag. Choose Add Tag from the bottom of this drop-down list. (By default, all Game Objects are marked "Untagged")
    Time for action – tagging the tray
  3. We're taken to the Tag Manager. Click on the gray arrow beside the word Tags at the top of the list.
  4. There's an invisible text field next to the line labeled Element 0. This takes a leap of faith the ...

Get Unity 4.x Game Development by Example Beginner's Guide 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.