How can I use a collision box to both pause a timer and increase a progress bar when the progress bar is slowly decreasing everywhere else?

Timers have handles, once promoted to a variable they can be accessed freely and support pausing:

Perhaps that’s what you need.

Description -
I am trying to create a health system where the player’s health will slowly decrease unless they are in specified areas that will increase their health. (I am using this as a hypothermia system, so if the player is away from a heater, they will get cold, when they are close, they will get warm.)

How would I be able to pause the health timer, and slowly increase the players health, when they enter this collision space?

Problem - I have a timer set up so that I will slowly be decreasing the player’s health at at Event Begin Play and when I walk into a Trigger Box, I get a boost of health. The timer does not pause when the player overlaps with the collision and just gives them a boost of health.

Health Timer Blueprints

Health Depletion -
I have set up a few functions to work through the system so far, On event begin play I call the Set Health Timer that holds the Deplete Health function in Health Timer Name.

Adding Health -
Here I have a check to see if the timer is active and set to add health to the player if that’s the case. I have tried different methods of pausing it but I can’t seem to figure out what I would need to do. I then call the Add Health function in the Level Blueprints from an OnActorBeginOverlap

I think this will work, but I’m having some trouble with calling it. I was able to get the timer function to pause but I’m having some trouble setting it to happening only when I am inside the collision box. I have it set, so far, to that when I step in it heals the character but it doesn’t unpause when I leave the box.

Would I need to make a new function for it to hook up to OnActorEndOverlap? At the moment, I have it hooked up to the “Add Health” function that gets called on actor overlap in the level blueprints.

Would I be able to handle both the pause and unpause actions in the single function?

Yes you should ‘SetTimer’ during ‘OnActorBeginOverlap’, and ‘ClearAndInvalidateTimer’ during ‘OnActorEndOverlap’.

After SetTimer, hook the return value and click “promote to variable”. Then use this variable when you ClearAndInvalidateTimer