Using latest version (2.28.1), I have trouble with playing my Death animation on my combatants. I use a custom script which is specified in my combatant's Animation settings, and I linked my animation function in the Base/Controls Animation settings by using a Custom Animation for the Death Animation Type. Then, in code, I use combatant.status.Death() to kill it (I also tried HasDied()). It used to trigger the animation, but it doesn't seem to work anymore.

Could this be a problem with the latest update?
  • The Death function will add the combatant's death action to the system - if you're using battle events to animate death, you need to use a Calculate node in it to trigger the death animation (or do it manually via animation nodes).
    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 patreon.com!
  • I'm not using battle events to animate death. In my code, I simply set the DeathState of the combatant by using the Combatant.Status.Death() function. Previously, when I did that, it automatically triggered the OnDeath() function (as specified in "Base/Control"/Animations/Custom Settings/ Custom Animation 0/Play Function) on my custom animation component (the one specified in Combatant Settings/Animations & Movement/Animation Settings).

    Since I updated however, it seems that it does not call the OnDeath() function automatically anymore. The only way I was able to make it work is by adding a combatant.Status.DeathStateChanged callback on my combatant's game object, and then call OnDeath() on my custom animation component.

    I wanted to know if anything changed in the code of the latest ORK Framework update that could have caused this change of behaviour, or if it has to be on my side.

    Thanks!
  • edited April 2020
    Doesn't matter if you're using battle events or not - calling the Death function will add the combatant's death action to the system to be performed. If no battle events are used, it'll just do the same as calling the Calculate node, i.e. playing the death animation type on the combatant and calling the Died function.

    This only happens if the combatant isn't dead yet, though - i.e. if IsDead is true, the death action (and thus playing the animation) isn't happening.

    From which ORK version did you update to the latest version? E.g. updating from 2.28.0 didn't add any changes to that functionality.
    Post edited by gamingislove on
    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 patreon.com!
  • I updated from the latest beta version just before 2.28.1. So it can't be that...

    Just to make sure that the Death action animation was set up properly, I tried a Combatant Animation step in a game event, in which I specified to play the Death animation type... And this worked perfectly. So, it proves that my custom animation system is hooked properly to ORK. When I use the combatant.Status.Death() function, it also properly updates the combatant component's basic information Is Dead to true and the callback combatant.Status.DeathStateChanged is also called properly, so it proves that the death state is set properly.

    So, somehow, even though the animation system works and the Death state is updated, the Death action is not triggered. How could that be?
  • That'd depend on your system's state - if you're out of battle or in a battle system with using death immediately, the action would be used immediately, otherwise it'll be used when the next action is called by the battle system.
    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 patreon.com!
  • I've tried out of battle. Still, my OnDeath() function in my custom anim system is never called when the combatant's death state is changed using combatant.Status.Death(). As I wrote earlier, it's called if I use a Combatant Animation step with Death Animation type.

    I guess I'll simply call the OnDeath() function on my own in the OnDeathStateChanged callback...
Sign In or Register to comment.