Progress Bar Not Stopping

Hi! I’m working on an oxygen progress bar that starts depleting at the start of the game and when it reaches 0, the character dies. The logic with the bar works perfectly, but when the character dies, and the game starts again I keep getting an error in the widget’s function, specifically with the “Get float variable” and return node.
Is there a way of restarting that logic or to stop trying to get the float variable when the character dies? I think the problem is with the Clear and Invalidate Timer by Handler node, because I was thinking of using it just before entering the death animation, but it didn’t work.
This is the Character Logic of losing oxygen:

The problem is here, because the Function is trying to obtain the Oxygen float variable, but it can’t when my character dies.

Hey @GrandmasterPanch!

If your widget logic is still running “on death”, have you tried clearing and removing your widget when you die. You already recreate it on “game start”, so removing then recreating it when you restart the level may be a possible solution.

Hi! Thanks for answering!
Just tried what you said and it worked!
Is there a node or a function to remove a specific widget? Cuz I have a “You’re Dead” widget when the character dies and it gets removed with the Remove All Widgets node.
I mean, it’s not a big deal. Maybe I can use another way of displaying the game over message, but if there’s a node for removing a widget it could come in handy.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.