Make stamina value only drain when sprint button is held and player is moving?

I’m new to Unreal Engine 4.7.6 and I was following a tutorial online to set up a little basic game and was setting up the sprint mechanic. Well, there is a slight issue with standing in place and holding the run button where the stamina will then go down anyway without moving. I was hoping someone would be able to help me resolve this issue. I simply want the stamina value to drain when the player holds the sprint button and is moving, not when they hold the sprint button and stand still. I didn’t see this answered anywhere else except for multiplayer server game layouts, so I decided to ask. Any help is much appreciated. Thank you in advance.

I think you want to do something like check the charactermovementcomponent if accelration is not 0.

What would I have to change to add this in?

I know this is 3 months old but I found threads with similar questions (I needed this as well) and found a solution through different threads.

You and I followed the same Sprint-tutorial and it’s pretty simple to implement the “drain-only-when-moving”-feature:
First we check if the player is Sprinting (holding down Shift) - if it’s false, we’ll regain stamina. If it’s true we move on to check if the player is actually moving. We do this by getting the velocity of the player and checking if the velocity in any direction is equal 0, which means he’s standing still. If he’s not standing still (false) he’s Sprinting and we drain Stamina. If he’s holding down Shift but not moving (true) we should be regaining Stamina.

Credit to for suggesting “get velocity”.

(How to detect player movement? - Blueprint - Epic Developer Community Forums)

My method is in Spanish, sorry. But the method has worked perfectly for me, when I shift, the resistance no longer drops without moving, it only wears out when I move and shift.