How to make the player character inmune for a short time after overlapping an enemy character?

Hello!

I’ve been trying to make my character getting hit by overlapping an enemy after being inmune in a platformer game.

I created a boolean to make it inmune, which activates once it gets hit and changes the collision response for the Enemy to “Ignore”. Then it receives a pushback (which is working fine with a Lauch node) and if there’s enough health, after a short delay the inmunity boolean deactivates and the collision gets is set to “Overlap” again. It works fine if the player is getting hit and is pushed back outside of the overlapping collision box. And if the player comes near the enemy again, everything repeats as intended.

But if the player stays in the overlapping collision box after getting hit and pushed back, it won’t receive damage until the characters aren’t overlapping and then overlapping again.

How do I solve this?

Here are 2 Images about my Main Character Blueprint Nodes and one from an EnemyBP.
Thanks for the help!

Doesn’t the overlapping ends if the main character collision is set to ignore? I thought that was the case… Thanks!
But I still can’t figure it out how to set this up…

You have a begin overlap but not end its saying your hit and staying hit

Not sure if this would work in your case, but wouldn’t it be easier to add a delay of the intended immune time, at the end of the delay set the boolean to false, change the enemys collision back off ignore and do a manual check to see if they are overlapping since the begin overlap won’t fire again?

OnComponentBeginOverlap fires once when a new actor is being overlapped, not repeatedly. When an actor is no longer overlapping the said component, OnComponentEndOverlap fires instead.

Thanks a lot!

The first part is what I already did in the Player Character, but I didn’t thought about changing the collision response to the Player Character in the Enemy BP too. I’m not sure why it has to be both ways but I’m glad it’s working now.