Help in creating an oxygen bar


Really sorry for what is possibly a really easy problem, but how do i create an oxygen bar that is always depleting?

I tried googling how but came up empty (my google-fu kept leading me to links about actual oxygen bars lol). With a bit of tinkering, i figured a progress bar widget would be my best best. I can even make it lose air by being “damaged”, but buggered if i can figure out a way to make it constantly, and steadily, deplete as soon as the level has loaded.

So yeah, any help would be greatly appreciated.

P.S. My end goal is to have upgrades for the air tanks to deplete slower, if that makes a difference at all.

So, you have a progress bar:

You binding it’s percentage (0 to 1) to the value of a variable in the player (OxiLevel):

And in the player, you control the inc/dec of the oxygen levels, by setting the value of OxiLevel. To make it decrease continously, use a timer. In this example, it decreases 0.01 every 0.1s:

Hey. Thanks for the help. Its exactly what i was looking for.