How to create a Time Limit decorator with a custom condition?


I’m trying to create a behavior where, if an Enemy is trying to attack a player but fails to reach them after X seconds, they will give up and instead do a ranged attack. But NOT do the ranged attack if he first attack went through.


The problem is, if I understand correctly, UE’s built in Time Limit only checks if the action succeeded, which happens at the end of the attack.

I want to make a custom timer that stops counting if the first attack STARTED within the time limit.

Try extracting the timer out to a float that is a blackboard key. Then you can access it’s value / change it in different blueprint tasks & services.

Melee attack count


Ranged attack count

BB keys

Attack methods

Check distance service

You can then use blackboard condition nodes to check the elapsed time

Target Find done before move resets the timer once a target is found => then next node is moveTo target actor

I’m sure you can build the final tree with bb conditions and timer key & distance checks.

1 Like

Yeah, that’s pretty much what I needed. Making an Enum for attacks is also better, thanks a lot.