I want to have a general health script for all NPC’s, Enemies or Creatures so when a spell hits them it can handle damaging health.
Within that script I want to reference a more specific script so, say the health drops below 0 the script can call a function called Died() that I’ll put in each specific script, these would be anything from Chicken to UberDaemon. So the Chicken prefab would have a Chicken script to do the specific stuff and likewise UberDaemon an UberDaemon script.
So the damage done by weapons or spells can tell the health script to do damage but if the damage kills the Creature or NPC etc. when Died() is called the animation are unique.
I can reference scripts but that seems to need the script name so not really generic.
Is it possible or do I need a different approach?
Thanks