O'Reilly logo

Unity 5.x Game Development Blueprints by John P. Doran

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

Damaging and killing enemies

Now that we have enemies moving towards us, we need some way for them to be damaged and killed! Let's do that now by performing the following steps:

  1. The first thing we need to do is make it easy to get a reference to all of our enemies, so let's add a tag by going to the Inspector tab and navigating to Tag | Add Tag…. Once the Tag and Layer menus come up, type in Enemy into Element 0.
    Damaging and killing enemies
  2. Then, go back to the Ghost_mesh child object, add the Enemy tag to it, and rename the parent object to Ghost:
    Damaging and killing enemies
  3. Next, let's dive back into ...

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