Download

Proper way to "pause" AI-Tree while attack is playing

I’m trying to build my first AI. Currently it just walks some random steps, checks if it is in Attack-Distance to the player and than calls an interface to trigger the attack-animation. This works reasonably well, but my AI tree continues while the animation is still playing and begins walking some random steps again. And I can’t figure out what the recommended way is to hold and communicate back when the attack is finished.

As far as I know there is no way to pause the Behaviour tree from a blueprint or to set a flag on the blackboard that an animation is playing/finished playing. So what is a proper way to set this up? How do I get this information back to the tree?

Hi, you can execute a task in your behavior tree and let it finish when your attack is finished. For example in your task you could bind to some event dispatcher in your pawn that executes when the attack has finished and from that finish the task.

1 Like

Thank you, that solved my problem!