Hello everyone, I’m having trouble with a sprinting logic, I tried using it in two different projects but for some reason I can’t get the gamepad left thumb stick button to work for sprinting, at first I was using a different button that was working fine and then I changed my mind and started using this new one but whenever I tap the button it doesn’t stay sprinting
Hey @Twan_so-kl how are you?
As far as I understand, what you want to do is to tap the left thumb stick to start sprinting and then tap again to stop sprinting, right?
In that case, the problem is you are making the sprint stop when you release the button, as you can see in the following image:
“Completed” means you released the button!
You shouldn’t have any logic there. You only need to check if “Is Sprinting” following the “Started” pin, if it is true call “Stop Sprinting” and set the boolean false, if it is false run your Sprinting logic and set the boolean true!!
That should solve the issue! Let me know if it worked or if you need more help!
Hello again @Twan_so-kl !
I think the easies approach for that is to call your “Stop Sprinting” function When you release your movement input. Of course you will need to repeat the check for the boolean “Is Sprinting”. You will also need to add some other checks to know if player is pressing any other movement key/button, as you don’t want to stop sprinting if you released left key but you are still pressing forward key for example!
Another possible approach for this is to check the speed of the character and then call the “Stop Sprintign” function if the speed is below a certain number. You can calculate the speed like this:
You can choose the method that best suites your needs!
Let me know if any of them worked!
Sorry I took so long to provide an update. I did find a method that works, but I’m not 100% sure it’s foolproof yet. If anyone wants to give feedback or even try using it, this is what I did ![]()
I created two sprint action inputs one for the left Shift key and the other for the gamepad left thumbstick button. Inside my event graph for the Shift key, I placed the “Start Sprint” logic on Triggered, so I have to hold it down to sprint.
For the left thumbstick, I used a FlipFlop node to set “Is Sprinting” to true or false. However, it didn’t end there. I also had to create a function for the player’s movement speed on the Event Tick, so the player can only sprint if they are moving forward or moving at all, since I was using the FlipFlop node, this ended up being the easiest method. Now, if I’m sprinting with the thumbstick and stop moving, the player’s sprint resets back to walking.
Sorry if the explanation was bad







