I was wondering if there is an easy way to setup an Idle animation that changes when a combatant is at low health, or suffering from an ailments.

Right now the combatants play their dodge animation when an attack misses them. I can set mecanim to transition to the idle, but they'll just go back to standing up straight when they were kneeling just a moment before.

I expect there will be more instances where this would be a problem if I don't fully automate the process.

Maybe creating a standard event to check the user and target both at the end of every ability could work, but that's not a very graceful solution either. :/ Any ideas?
  • I'd say the easiest way is using a status effect that overrides the combatant's animations (e.g. in your case, the idle animation). See the effect's Animation Settings, which are nearly at the bottom of the settings :)

    You can use the Auto Apply settings of the status effect to e.g. automatically add it to a combatant if the combatant's HP is below 20% (or other status requirements). You can also keep the effect hidden from the player to keep things orderly by enabling Hidden in the effect's base settings.

    If your ailments are status effects, you can also override the combatant's animations in them.
    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 think there's still a problem then. I'm using Mecanim.

    The transition from the evade animation is set to just have an exit time. Using the damage types settings I have the evade animation trigger, but after that animation there's no trigger and I don't think I have any control over what happens after. So in order to go back to the idle animation I just have mecanim setup with an exit time.

    I can't change that transition through this right? I would have to switch out the animator, which might be possible. Then again, having 2 animators for every single combatant just to have a low health idle, seems sub-optimal as well. :(

    Am I missing something here? The tutorial on mecanim also puts the transition from evade on an exit time, with no trigger.
  • ORK's mecanim tutorial is just one way to set up (and pretty simple at that). Mecanim is a complex system that can be set up and used with ORK in many ways.

    Since a trigger parameter is reset after being used it's mainly for one time animations - if something should be persistant, like your low health state, you should use bool parameters.

    If you're using a status effect for the weakened state, you can use the new game event feature (in ORK 2.27.0) and use game events to set a bool parameter (to true) when the effect is applied and set the parameter back to false when the effect is removed.
    That way you can set up transitions to different animations based on the bool parameter, transitioning to the correct idle animation.

    In case you want to manage multiple states (e.g. normal idle, low health idle, poisoned idle), you can also use an int parameter instead.
    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!
Sign In or Register to comment.