Stopping damage from a trigger volume

Hey, I’m trying to cause damage to the third person character. I have managed to get the trigger volume to cause damage infinitely whilst I am in it, I just need it to stop once I am out. Please help and thanks in advance.

Your problem is that you have a loop continuously applying the damage and, once started, there is no way to stop it. You need to change your approach.

For example, create a bApplyDamage boolean variable. Set its initial value to False.

From Event ActorBeginOverlap call a DoOnce, from it set the bApplyDamage variable to True, then call a WhileLoop that applies the damage and has a Delay at the end (like you did in yours). The WhileLoop must be controlled by the bApplyDamage variable, so as long as that variable is True it will continue to loop and to apply the damage.

Now create also an Event ActorEndOverlap. This event should set the bApplyDamage variable to False, then connect to the Reset Pin of the DoOnce.

In this way, when you exit the Trigger volume, you stop applying the damage and reset the DoOnce in case the player would enter the same trigger volume again.

Give it a try and ask again here should you encounter any issue.

Thanks, I think I have a starting point from here, but I’m still within the early stages of learning Unreal, so I still get confused easily. Where do I go from here?

Looking pretty good, but it needs some fixes.

Event ActorBeginOverlap

Remove the ApplyDamage from the Start Closed of the Do Once, you don’t need it there. Start Closed should be unchecked.

After the DoOnce you need to set bApplyDamage to True, otherwise the WhileLoop will never be executed.

Add a Delay after the SET Max Health otherwise it will kill all your health very very quickly.

Event ActorEndOverlap

Remove the DoOnce, you don’t need it there

Out of the event execution pin, SET bApplyDamage to False. Then connect the output execution pin of the SET to the Reset input pin of the DoOnce attached to the Event ActorBeginOverlap