Download

Executing code block while Two Actors are Colliding / Within each others bounding boxes

So I am working on a 2d game and I am trying to figure out how to execute a block of code I have anytime an actor collides with another actors bounding box AND while the bounding boxes intersect. Basically, I am currently using the Event Actor Begin Overlap event to run this code, but obviously it only fires once when the bounding boxes cross initially. I need the code to execute on the initial cross, but also constantly while the one actor is still within the bounding box of the other actor. Here is a copy of my blueprint. How could I correct this?

1a2f18d8619597c98cea01f286be562524c681ed.jpeg

Hello,
To execute a code during time, i would use tick. I would set my function with tick event as start and add a bool on start “hovered”. On event begin over, i set “hovered” true and on event end over i set it false. to avoid issues i would add the use of “is hovered” “overlapping actors” and set “hovered” false and exit if for some reason overlap is end without end overlap (dead / bug…)
If there are more than one contact, i would set the function in enemy and use the other actor output to cast to player to avoid confusion with “hovered”.