Hi everyone. I recently created a 3-part video tutorial on how to create a Stamina Component that is not only modular but also fairly robust against edge-case scenarios that a lot of stamina system implementations seems to have an issue with; for instance, stamina continuing to drain if the character bumps into an obstacle/wall and is no longer moving (but the player is still holding down the run input), or just general player button-mashing.
Free project files: Microsoft OneDrive
Part 1
Part 2
Part 3
Part 4 (Bug Fix)