After creating the combatant, I connected it as follows.

enemyCombatant.Status.DeathStateChanged += DeathChanged_Enemy;

When that combatant dies, DeathChanged_Enemy method is fired twice.
(Should be run only once)

Unity console



As above, both paths seem to fire the event each.

I want to control death through scripting, is there a solution?
(Not the editor's death event)
  • Working as intended - there are 3 death states, alive, dying and dead.
    When a combatant is killed, it'll first change to dying until the combatant's death event finished (which causes the dead state upon it's calculation).

    You simply have to check the combatant's death state in your called function to react to the one you want.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on!
  • Thank you for answer
    In fact, it seems to have been executed twice by writing it like
    if (combatant.Status.IsDead) {
    my mistake..
Sign In or Register to comment.