October 2017
Intermediate to advanced
568 pages
11h 8m
English
The Attack state is entered when the zombie arrives within the attack distance to the player. During this state, the zombie repeatedly attacks the player until either the player dies or the player leaves the attack distance:

Consider the following code:
//------------------------------------ public IEnumerator StateAttack() { //Run attack animation ThisAnimator.SetInteger("AnimState", (int) ActiveState); //While in idle state while(ActiveState == AISTATE.ATTACK) { //Look at player Vector3 PlanarPosition = new Vector3(PlayerTransform.position.x, ThisTransform.position.y, PlayerTransform.position.z); ...Read now
Unlock full access