- The StateAttack coroutine begins and remains throughout the Attack state.
- The Transform.LookAt function is called during the coroutine loop, on each frame, to reorient the enemy to always face the player character.
- If the enemy falls outside the Attack distance, he reverts to the Chase state to catch up with the player. The distance between player and enemy is determined by the Vector3.Distance function.
- If the zombie reaches StoppingDistance from the player, they stop moving and continue to attack.
The Attack state, as it stands, is not sufficient to actually inflict damage on the player. The StateAttack coroutine, for example, contains no code to interact with the player character and therefore causes no damage for each punch ...