have a enemy die?

i want to be able to kill a enemy and have their A.I stop and play a death animation. Any idea how to do that, i am using the BurgZergArcade’s health script and A.I script.

It’s not related to that tutorial (I don’t remember it exactly so) but here are general guidelines :

  • Your enemy is going to loose health when an event occure (hit by bullet / weapon, receive a spell in the face, is blasted by an explosion etc). It’s up to you to let the enemy know that event happened, and to determine the effect, the damage.
  • Your enemy was hit by 5 damages points, and have 3 points, he dies, initiate dying procedure.
  • Instantiate the dying enemy, or start an animation, particles, whatever.
  • Send a letter to that poor guys relatives, it’s no laughing matter to loose someone, you murderer.

animation.Play(“animation”);//place this under function or if/switch statement.