Fast atack animation not good.

Hi, I did an attack animation for my character, everytime I press the left mouse button he makes the atack animation, the duration of the animation is 1.4 sec. The problem is if I press very fast the mouse button, so he stops the animation and starts from the beginning, I mean, we can not see the animation when pressing several times.

Do you have any tips?

What I can do in the animation blueprint or in the character blueprint to wait all the animation before it can accept a new one? I tried to make an delay, but the left mouse button always works when you press it.

Thanks.

Make sure that you have looping turned off on the animation node itself. That will keep it from restarting

There are multiple ways to deal with this, one way I use a lot for stuff like this is to use a DoOnce node to control the event.

So the setup is, right after your mouse input, add a Sequence, this allow you to split the event to 2 or more, by default it has 2 outputs, that’s all you need. On the first output hook up a DoOnce node, then on the second output hook up a Delay node, then hook the Delay node into the Reset of the DoOnce. Hook your attack event after the DoOnce.

What this does it, when you press the button, it fires… but only once, then after the delay it resets the DoOnce node and then it can fire again allowing your animation to play out first, no matter how much you tap your mouse button.

Thanks guys.

Obihb, this solution was really simple. Now it`s perfect. Thank you.