Replenish Stamina coroutine

Coroutine is again the wrong approach here.

This is just a cooldown timer from a different angle.

Have a counter that starts with your stamina.

If you try to run, check if there is any value in that number and count it down.

If there is no value, then disable run.

When the user isn’t running, slowly charge the amount up, adding to it each frame.

It’s just the opposite of a cooldown timer.

Cooldown timers, gun bullet intervals, shot spacing, rate of fire:

GunHeat (gunheat) spawning shooting rate of fire:

1 Like