Attack animation keep on playing

A picture of your statemachine would help to see how it’s been set up.

I’m currently getting into animations and Animation Blueprints myself, so I can’t say that I’m that confident in the subject.
It does however sound like you’re running directly into the attack animation without there being any transition rules in place.

Image below is of an Animation Blueprint for a deer.
When I hit play, the deer is in it’s idle state.
The lines between the Idle-state and “walk” have transition rules. Do you have anything like this?

286833-locomotion.png

With these rules (and some Blueprinting in the AnimGraph of the Animation Blueprint) I can basically say that that whenever the deer stands still, it should play its Ide animation. Whenever velocity in the X or Y axis is detected, play the deers Walk/Run animation.