Is there a robust way to check if anim is playing in conditional rules of AnimBP

Apparently such a function/method (IsPlaying()) is available in code:

All the solutions I’ve found on finding out if an anim is playing in BP seem really tedious.

I’ve tried to:

  • set up notifies in each animation, flip a bool in the anim_BP’s event graph when fired, check that bool in each conditional rule for every attack animation.
    However, I just found out that solution fails if the animation is interrupted/stopped before it gets to the notify for not playing. I can, but don’t want to, make it so the player has to sit through the whole animation.

  • check if it was playing via time_remaining, but it’s not reliable unless I specify an arbitrary cushion (remaining < .1s, opposed to . <.01 which triggers only 33% of the time). And it takes an extra node (<, >, etc.).

The reason why I am checking is because I need to turn on and off the damage the weapon can do. If I don’t it’ll damage stuff just by bumping into it (outside of the attack anim). It has to/should do damage only when it looks like there’s some deliberate force behind it.

Thanks in advance.

If the animation is a montage you can get a return Bool if it is active and playing via GetAnimInstance and then MontageIsPlaying you could use the return Bool to turn on or off the damage if the montage is playing and is it isn’t then the return Bool will be false.

The top would be used in the character BP and the other could be used in the weapon BP if you didn’t want it in the character BP. Might be an easier approach to set it up as a montage than to try to get it through the AnimBP.

(I changed my answer to a comment.)
Black Phoenyx,

I apologize for having not responded sooner. Thanks a lot for the thorough response.
I think I’m going to have to get my feet wet in montages. Initially I just wanted to do it through the state machine.

What you describe is exactly the thing I want to do. I vaguely recall it being a hassle to call those montages outside of the AnimBP, but that’s very likely on account I don’t know how to use montages fully.

Thanks again. I sincerely appreciate the time you took to pass on info!