The script currently attached to the female zombie, adequately handles its current states: Idle and Walk. We need to add a few lines of code to the script to trigger the face animation:
PACKT_Scriptsfolder is visible.
zombie_readyand double-click on it to open the script in MonoDevelop.
We will start by adding a few variables. At the top of the script, add the following lines of code:
var target : Transform; var alerted : boolean = false; var snarlSound : AudioClip; var soundReady : boolean = true;
target variable will store the player character's position. The next variable, alerted is ...