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:
- Locate the prefab
Zombie@attackby navigating to Assets | chapter5| chapter5_pack.
- Click once on this prefab, and in the Inspector window, click on the Rig tab.
- In the new window, select the option Humanoid for the attribute Animation Type and click on Apply.
- Click on the Animations tab, and then click on the label attack, this will provide ...