Trigger box breaks on AI entry

Hey, I have a simple trigger box that takes damage when the player is overlapping it, the blueprint logic is below for reference:

Everything works fine until something else (ie. AI) overlaps the trigger box, this breaks my code.

The collision settings for the trigger volume are below:

Thanks in advance for any help.

Not sure exactly what you mean by it “breaks”, that could be many things some clarification would help. BUT from what I can see, you will certainly have a bug where if the player enters the trigger box and begins taking damage, if an AI enters then leaves the trigger box the player will stop taking damage even if he is still within the trigger volume. The reason for that is because you don’t specify an actor for the “End Overlap” event. So any actor (even an AI actor for example) could cause the “End Overlap” event to trigger upon exiting the volume. Cast to your third person character for the end overlap like you did for begin overlap and it will resolve that issue. If you are having another issue please clarify because I don’t know from the screen shots what exactly would be “breaking” other than what I mentioned above.

I didn’t see that issue, but l have added the cast to the end overlap too , thanks. My problem is when anything else enters the trigger volume while my character is already in there, by break l mean the code stops working. Nothing happens. The player doesn’t take damage and l can’t understand why.

The blueprint simulation continues repeating the code while the AI stays in the trigger volume as expected, but the player doesn’t take damage and I’ve checked my “TakeDamage” function, works fine.

Found the fix. Made another cast inside the loop with a reference to the player character, all working now.