How can I make a system where player stamina is being used for sprinting, jumping, attacking?

I think you overengineered it a bit…

Can you try this setup of 3 functions and tell me if it works for you:


Where Stamina Change is how your stamina is regenerating or draining (depending on the sign) per second.

The benefits are: No timers, no delays, Stamina is calculated only when needed.
The caveats are: You have to go through GetStamina() to have it properly calculated before using it.

Edit: I wasn’t sure for the ContiniousStaminaChange weather you want your Change per Second to modify the Stamina Change or override it. It is currently overriding it but you can modify instead.

1 Like