Drain a number per second

hello everyone,

so i have two variables respectively named StaminaLossPerSec and CurrentStamina
i want CurrentStamina to decrease per second based on StaminaLossPerSec

is that possible? i was thinking of doing math.max(0, CurrentStamina - StaminaLossPerSec * deltaTime) (all of this in PreRender)

If you are sprinting the stamina loss can just be CurrentStamina - (StaminaLoss * dt)

1 Like

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