Make a temporary sprint

So I have a button on screen that when pressed causes the player character to sprint. I tested and that works as expected. Now though I want the sprint to be tied to stamina of sorts. So that you can only sprint for a few seconds then the sprint fills back up and you can do it again. I looked for posts about this already but couldn’t find what I was wanting. Any help would be appreciated.

Well you could try installing the resource bar extension and the structure your condition in such a way that,
if the player animation is sprint, and the stamina is not equal to 0, every x seconds, remove 10 points of stamina from the stamina resource bar. If the stamina is equal to 0 and the player animation is sprint, set the animation back to idle.
Then make another condition, if the player animation is not equal to sprint, every x seconds add 10 points of stamina, so it refills after some time.
Hope that helps
(You can search how to use the resource bar extension on YouTube)

1 Like

This makes sense. I’m going to try this tonight after work.