LeonFrei96
(LeonFrei96)
January 16, 2025, 10:21pm
1
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.
3dRaven
(3dRaven)
January 17, 2025, 12:20am
2
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
LeonFrei96
(LeonFrei96)
January 17, 2025, 4:52am
3
Yeah, that’s pretty much what I needed. Making an Enum for attacks is also better, thanks a lot.