Let’s say I have an “isAttacking” boolean my animBP is monitoring. When the user presses the attack button, it changes isAttacking to true, causing the animBP’s state machine to play the attack animation. This boolean is also used to prevent the user from interrupting the attack with other button presses (jump, dodge, whatever).
What’s the best approach to have isAttacking set to false once the animation is complete?
So far I’ve done a few things that work but they all feel clunky and it’s making me wonder if I’m approaching the problem the wrong way. One option is to have a timer in the character BP, but then I have to manually set the time to match the animation.
Another approach is to have an attack montage call an animNotify that’s hooked up to a function that resets the character’s isAttacking to false. So far that the cleanest approach I’ve found but it still feels… weird.
Is there anything better/cleaner?