How can I have a full loop attack animation continue as it follows the player?

This is my current blueprint for enemy AI to follow and attack the player:

What happens now is that, if the enemy gets close and a long attack animation plays, the enemy will stay in place playing the animation, and at that point the player can have run away and the enemy will stay where it originally started the attack animation.

What I want is a full attack animation loop that happens as it FOLLOWS the player, instead of staying in place. For example, when predator fish circle their prey, they circle them as they follow them, they don’t play a ‘circle’ animation and stay in place.

Do your attack animations use root motion? If not, then you could just play the montage as a layered animation (see Using Layered Animations | Unreal Engine 4.27 Documentation for detailed steps) so that your AI can still move towards the player while the montage is playing.

2 Likes

Root motion = Yes.
Is there an alternative to layered animation in this case?

In any case, thank you and I will keep digging and also look into Layered Anims.

Hey @Soaron!

If you are wanting to not base the motion of your character on your animation, you will need to disable root motion. And layered animations are a great way to go, especially if your “circling”, for example, is based on AI rather than an animation.

If you would like to look further into layering your animations I highly suggest this non-Epic affiliated video on Layered Blend per Bone:

I hope the above helps point you in the right direction.

Cool, thank you.

I wish there had been a couple things I could’ve plugged in to my blueprint that just made the enemy follow as animation plays. LOL

But yeah, you’re the 2nd to mention Layered Anims.

maybe use custom behaviour trees . Create sequential and selector nodes using anim graph