# Sprint Functionality

**URL:** <https://forums.unrealengine.com/t/sprint-functionality/476916>\
**Category:** Blueprint\
**Tags:** sprint, unreal-engine, UE4, question\
**Created:** [January 7, 2021, 5:12pm UTC](https://forums.unrealengine.com/t/sprint-functionality/476916 "2021-01-07T17:12:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prithviraj849](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Prithviraj849](https://forums.unrealengine.com/u/Prithviraj849)\
**Post date:** [January 7, 2021, 5:12pm UTC](https://forums.unrealengine.com/t/sprint-functionality/476916/1 "2021-01-07T17:12:55Z")

</div>

I am trying to create a battle royale game. In it I have added all the essential animations for movement but I don’t like how we have to keep holding shift to sprint. So I managed to make a functionality in which if we press shift once our player will start to sprint and stop only if we press shift again. After that I wanted the player to sprint in the forward direction without me pressing the ‘W’ key when in sprint mode. I found a short tutorial for it and found it was very easy. But It only worked when i did it with event begin and not with shift key can you please tell me if i have done anything wrong?

---

<div class="post-metadata">

**Author:** ![Prithviraj849](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Prithviraj849](https://forums.unrealengine.com/u/Prithviraj849)\
**Post date:** [January 8, 2021, 4:44pm UTC](https://forums.unrealengine.com/t/sprint-functionality/476916/2 "2021-01-08T16:44:03Z")

</div>

Here is the image of my blueprint forgot to attach it

 ![326671-myunreal.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/7/d/57d1bf8c49425117398899b93c2242abf96133f6.jpeg)

---

<div class="post-metadata">

**Author:** ![ConradG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ConradG](https://forums.unrealengine.com/u/ConradG)\
**Post date:** [January 8, 2021, 11:28pm UTC](https://forums.unrealengine.com/t/sprint-functionality/476916/3 "2021-01-08T23:28:22Z")

</div>

You should use the default method for movement input instead of what you currently have mocked up (its what comes setup when you first make the template project).  
Then, for your sprint input, you want to set max walk speed based on pressed and released.  
For pressed, max walk speed is sprint speed.  
When released, max walk speed is normal speed.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_bdbb94c3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bdbb94c3](https://forums.unrealengine.com/u/anonymous_user_bdbb94c3)\
**Post date:** [March 10, 2022, 4:26pm UTC](https://forums.unrealengine.com/t/sprint-functionality/476916/4 "2022-03-10T16:26:23Z")

</div>

Create a variable “canSprint” (Boolean) and make it true when shift is pressed and false when shift is released.  
Then from event tick take a branch with the condition canSprint And continue with your code
