How to make character's combo on repeat ?

Hello Everyone. I’m new to Unreal and I need help: I want my character to repeat the combo I’ve set it up but it only play it once and then stand still (even though enemy is still in the character range of view) can anyone help ? This is my blueprint

I think you will have to make bp task for the attack and add this to your behaviour tree so it can be check continuously.

Otherwise you can just recall the event Attack after the set bool but that not be ideal.

if this is a player character and you really want a potentially infinite loop (at the very least removing player control, the thing most people consider a core principle of being a game),
-take the out execution pin from your Set bool node and plug it into the in-execution pin of the branch
-or manually invoke the event again through a dispatcher.

this should be used with caution because it could create infinite recursion (calling the same function again and again without any way to get out) manifesting as what some would call a soft lock (the game is still running but there is no way to proceed.

a potentially better way would be to if the player is already attacking to allow them to attack again, but try to avoid functions calling themselves (or an infinite loop) unless it is the absolute exception, infinite recursion at its worst can even crash the entire system.

Well I’m trying to make a “tower defense” game and I want the player to focus on the stat instead of the fight. I need the character to attack enemy so the player know that the enemy is close.

I’ve heard about the issue with infinite looping so I want to do it safely.

About the last option to make them interrupt the attack, do you know how can I do it with the character A.I ? Or a way to loop the animation safely with out player interference ?

that is my misunderstanding (a Character is typically controlled by a player directly, or at least could, so I didn’t consider it to be an A.I. entity)
at which point I would put more strict checks then just a single bool (drop the bool, and then do a Square Distance check into the branch), then hook the out-exec pin to the in of the branch/Distance check

this can allow for potentially infinite recursion, but instead of a “select” (multiple inputs 1 output) node try a “switch” (single input multiple outputs) node, and make sure the default does nothing, with a delay into reset.

you could also switch out your PlayAnimMontage() into just PlayMontage() which gives you additional Exec pins like Completed and even Notify ability; So you can use the actual length of the animation instead of being wholly dependent on arbitrary delay amounts.