O'Reilly logo

Getting Started with Unity by Patrick Felicia

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 additional states

At this stage, we have created an interesting, yet simple, artificial behavior, whereby the enemies present in the maze will, if they see the character, or are within a specific radius, walk toward the player and alert all other enemies in this area. We will now include an additional state that we will call Attack, which will be triggered when these enemies are within reach of the player:

  1. Locate the prefab Zombie@attack by navigating to Assets | chapter5| chapter5_pack.
  2. Click once on this prefab, and in the Inspector window, click on the Rig tab.
  3. In the new window, select the option Humanoid for the attribute Animation Type and click on Apply.
  4. Click on the Animations tab, and then click on the label attack, this will provide ...

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