How to reset Doonce for animation


I want to reset the doonce for my animation from my AI enemy once it starts chansing you again.
Basicaly what happens now is the pawn roams between random points until it sees you.

When it sees you it goes into pawn sensing and plays the walking animation once trough doonce, otherwise the animation will reset every tick and that makes my enemy jitter.
But I don’t actually want the animation to only play once and not play anymore after its done chasing you.

What I want is to reset the doonce so that it can play the animation again if it starts chasing you again.
Right now I have tried every possible way of resetting it and either it keeps resetting the doonce every tick or it doesnt reset at all.

How do I reset the doonce once my Enemy is in attack mode (which is when it is less than 150 units away).

As a round up of what I was saying:

-my enemy needs to chase me and do the walking animation once during that.
-If it get closer then 150 units it will stop the walking animation and start the hitting animation. (because of the doonce, when it starts chasing me again after that, it won’t replay the walking animation).
-So I need to reset the doonce somehow.

Does anyone know how?

Here are some screenshots of the enemy blueprint:

Pawn sensing with doonce

Enemy attacking

A GIF of the problem

As you can see from the GIF, the walking animation doesn’t play again so the enemy starts sliding.



I would assume that you should just connect the false statement of the branch node to the reset of the “DoOnce” node. Because right now you are only firing logic on the “True” output of the branch and the false is not connected to anything.

Hope that helps :).


Thanks for your reply, I have tried it out but that made the animation jitter again probably because it was resetting faster then the animation playtime itself.
I have sort of fixed it however by putting the InRange boolean in the doonce reset.