How to stop player health damage OnComponentEndOverlap?

Hi,

I have made a basic health system for my player that in enemy BP OnComponentOverlap we GetPlayerPawn and apply 1 Base Damage to it. I.E you your player gets attacked by bees/wasps. This works like a charm.

The problem I am having is stopping this damage after you leave the area of the bees/wasps Collision volume. I have tried OnComponentEndOverlap getting the GetPlayerPawn and setting the Base Damage to 0 but this has no effect.

So, How do I stop it constantly appling damage to the player after he leaves the collision area?

Hi ,

Thanks for your reply, I continued to work on this problem and although it has taken me most of the day I have found a ‘work around’. It is not the best solution as it is checking for distance every tick. but htis is what I have ended with.

If you have any suggestions as to how I could implement this is a less intensive way, please do share.

Hi FirstParadox,

Can you show me what you have going on in your blueprint? I might be able to see what is happening and how to get it to do what you want.

Hi FirstParadox,

What I would do instead is create a gate that is opened when your player overlaps the component. Your tick feeds into the “enter” input. Then your end overlap plugs into your “Close” input. This will open the gate so that the tick can enter when you are within the overlap but closes the gate so no information can pass when you end the overlap. Try that and see if it does what you want.

Thats done the trick, thanks. Here is the final BP for anyone else with this problem