How do I deal damage ONLY when collision boxes have overlapped for a certain amount of time?

I have collision damage working fine , but I want the damage to only be dealt when the players and enemies collision boxes over lap for 2 seconds. (If my player escapes the enemies collision box before two seconds he takes no damage is what i’m after) I have tried a delay and all that does is deal damage 2 seconds later regardless of weather the collision boxes are still overlapping or not.
All help is appreciated.

good morning :slight_smile:

this should solve ur problem.^^

u have the overlap event which goes into a triggerable delay (so it resets every time u begin overlap) and the key is to ask if it is overlapping after the 2 seconds again :slight_smile:

i made a simple sphere collision here and get a filtered array of the playercharacter (so u dont get all those other actors overlapped) , this works on player side the same way. if you for example have a “Basic enemy” bp and all child Bp’s of that would be enemy , so u just have to filter the basic enemy instead of different classes.

Good morning! And a huge thank you! Retriggerable delay was exactly what I needed. Thank you very much :slight_smile:

Here’s the code now

it would be nice if you could mark it as a answer :slight_smile:

Marked it, First question on this so I didn’t really know how :slight_smile: thanks again