infinate stamina bug

HI, I’m trying to make a stamina mechanic although it works, the bar empties and refills when stop. for some reason if i empty the stamina and let it fill up anywhere between 1 and 99 i got and infinite stamina, causing the progress bar to flicker.

Try clamping the stamina calculation, it’s much easier :wink:

Clockwork is correct, but I personally don’t like the Retriggerable Delay here for what you’re trying to do. Because it’s so short, you can get away with it (for most players)… but if the player spams the button, they will NEVER deplete/recover stamina (because they will continue to interrupt the delay). You need a GATE, DO_ONCE, or Boolean.

I tried clamp that didn’t work for some reason

That could be something I’ll try that, thank you

Clockwork is definitely correct. What did you clamp? (If you decide to go the TENUOUS clamp route, you’d be clamping the output of your adder.)

That would make the Stamina NEVER exceed 100.