ALMOST finished stamina system :(

Hello, I have created a stamina system which depletes as the character sprints. The issues are 1) When it reaches 0 the character does NOT STOP sprinting! I do not know how to remedy this. 2) I cannot figure out how to make stamina regenerate while isSprinting = false. I have included screenshots!

Sprint inputs:


This is the depleteStamina function. StaminaTimerName is just a string that says “depleteStamina”

This is the hunger and thirst system:

Any help would be greatly appreciated, thank you.
Nate Olson

Hi Nate,
I can hardly make out anything in the screenshots and since my eyes are bad enough I won’t bother digging in to much. What you need to do is set your walk speed back to default (600) again once your variable is equal to 0. I can see you can use Set Timer by Function (I didn’t play with that too much yet) you should be able to work it out.
However not to leave you hanging I will post a very crude way of doing what you want. I’m sure this has been answered somewhere with a proper code but maybe this will be all you need. It’s based of custom event. Hope this will be at least of some use to you. See screenshots. I think it’s pretty self explanatory but if you need some clarification, just reply and I get back to you as soon as I can.

You can try searching for answer on Answer Hub, I’m sure there is better (pro) way of doing it.

This is a collapsed graph, mainly just to keep things tidy, ( any nodes in the main graph can be collapsed)
this is for gently adjusting the walk/jog/sprint speed,

Set the Target speed variable where you would have set max walk speed and have this after, this results in smooth speed adjustments for blend spaces… (also research acceleration setting in the character_movement details panel)

This is my old stamina system, I haven’t tidied it up, so no laughing :slight_smile:
It should cover all your needs, you could work the above collapse graph in where the max walk speed is set… just something to give you a few ideas.

break down