How to play different animations depending on conditions?

Hello, guys! Sorry for the stupid question… I’ve searched through all of the internet but can’t find a solution.

I try to play different jump animations depending on certain conditions. If a flip is possible, I want to play flip. If it isn’t possible, I want to play a simple jump up animation. I’ve already built all the necessary conditions, but I completely don’t know what to do next.

I know that I can use just “play animation” there, but how can I join it with the state machine? It even doesn’t trigger anim notifications. Is there some way to control state machine anims from the player blueprint?

I may be missing something, but can’t you just set a isFlipping boolean in your anim graph, and handle it in there? That’s the entire purpose of a state machine- playing different animations based on boolean conditions.

Unfortunately, it doesn’t work in my case. My conditions are in the PLAYER blueprint, and I can’t get any variables from there in the anim graph… :frowning:

You very much can:


This is how you can get the owner of the animbp from inside said anim bp.

You can also just use Get Player Pawn since that animbp is exclusively for the player.
image

To get a reference to the anim bp from your player, you can use the GetAnimInstance node:
image

2 Likes

Oh, really, I can. Thanks! What can I say? The second night with unreal engine :wink:

2 Likes