AI Attack Behavior Summative

You will be adding an attack behavior to your enemy AI. You will start by creating a flow chart – you can make with paper and pencil or use PowerPoint (all the shapes are in the shape tool). Make your flow chart as detailed as you can (look at the requirements listed below).

Once your flow chart is done, start setting up the attack animation and programming the behavior. Use your flow chart to help direct you through the process (solve one box at a time). Make sure you fulfill the requirements listed below.


  • When the enemy gets close enough to the player to hit him with his weapon, start the attack.
  • Play an attack animation (animations are in the pro melee axe folder)
  • Decide how you are going to check to see if the player was hit
    • Colliders
    • Distance/LOS
  • Make sure that you check for a hit at the right time (When weapon is moving through the area in front of the enemy)
  • Deal damage if hit (Debug a message for now)
  • Implement an attack cool-down so the enemy doesn’t spam the attack.


  • 30 Points – Detailed Flow Chart
    • all steps in a logical order
    • broken down in to little steps
  • 10 Points – Animation plays correctly
  • 25 Points- Hit detected at the right time
  • 10 Points – Damage Message displayed in the console if hit
  • 25 Points – Attack Cool-Down implemented

This will be a summative grade. Due date to be determined.