Injured vs. Uninjured Animation BP/State Machine Dilemma

Hi everyone,

So, I’m a newbie when it comes to state machines in an animation BP. I downloaded an injured animation pack from the marketplace, but there was no documentation on how to set up a state machine. And I have no idea how to switch between a healthy/non-injured state and a damaged/injured state. I watched a few tutorials on YouTube, but nothing specific to what I want to do.

This is my dilemma: I have a health variable (float) set up in my third person character. I want my character to switch to an injured animation state after falling below 0.5 with that variable. And after using a health kit to raise the health above 0.5, I want the player to return to a normal uninjured state. I tried carrying over the health variable into the animation BP event graph, but was unsuccessful.

Can anyone help/assist me with this? I would greatly appreciate it!

There many ways you can do this.

One example way:

You could add a “IsInjured?” boolean variable to the AnimationBlueprint and set it when the animation bp is updated.
You could then setup two different state machines (one for injured and one for healthy) and them in the animBP the following way:

I did that, but how can I account for health (float value)? I assume I have to set it with the Bool somehow.

You could do something like this:

Is there a way to tie this all into my third person character BP? I have a health/armor widget that is displayed there, and I was wondering if I could tie it together. The state machines work, though, so thank you for that!!!

Ok, then please accept this answer, so it is officially resolved.

I dont know exactly what you mean by that but as you can see, in the event graph of the animBP we are getting the health from the third person character BP.

Instead of getting the health you could write a function that returns the health in the third person character BP. This function could take anything into account that you are using. Such as armor etc.

Never mind, I figured it out! All is good now, and everything works great! Thank you again! I spent the entire day agonizing over this haha!