What is the best way to pause AI evaluation for the duration of an animation?

Hello!

I was wondering the optimal way to pause a pawn’s behavior tree selection while an animation (which is variable) is playing.

At the moment I am using notifies at the animation’s Start/Finish to change a variable on the Character which the AI then checks in a service and loops in a wait task while this is set. However, I am working on a networked project so the only way for that variable to be properly set is for the animation to be performed on the server so the notify triggers on the server. Is there a better way to do with this without running the animation on the server (or better in general)?

On a similar but separate note, I am also toggling collision components on the character based on notifies so the collision is only active during a portion of the animation. If there is a better way to do this as well please let me know!

Thanks!

You can lock the logic resource on the brain component right before you play the animation and unlock it when it finishes. I do this for stun hit reactions.

You may write your own BT task and use animation montage for direct control of the animation.