# How to sprint only forward!?

**URL:** <https://forums.unrealengine.com/t/how-to-sprint-only-forward/478288>\
**Category:** Community & Industry Discussion\
**Tags:** sprint, unreal-engine, question\
**Created:** [February 5, 2021, 3:37pm UTC](https://forums.unrealengine.com/t/how-to-sprint-only-forward/478288 "2021-02-05T15:37:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![BronzeBeetle](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BronzeBeetle](https://forums.unrealengine.com/u/BronzeBeetle)\
**Post date:** [February 5, 2021, 3:37pm UTC](https://forums.unrealengine.com/t/how-to-sprint-only-forward/478288/1 "2021-02-05T15:37:13Z")

</div>

![328956-cap.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/6/8/368d21bdb1037d28865cf7a632d62d249458b6e0.jpeg)

Hi, I want to know how to make my character sprints only forward. The problem now is when I use sprint it will sprint left, right and back. Here is my bluprint:

---

<div class="post-metadata">

**Author:** ![Detach789](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Detach789](https://forums.unrealengine.com/u/Detach789)\
**Post date:** [February 5, 2021, 5:29pm UTC](https://forums.unrealengine.com/t/how-to-sprint-only-forward/478288/2 "2021-02-05T17:29:55Z")

</div>

Hmm…just to learn a bit more about your goals:

Is the character intended to always be sprinting if they are moving forward? Or is there a “normal speed” option and then they press a button to sprint (but only forward and not other directions)?

---

<div class="post-metadata">

**Author:** ![semi.essessi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@semi.essessi](https://forums.unrealengine.com/u/semi.essessi)\
**Post date:** [February 5, 2021, 5:57pm UTC](https://forums.unrealengine.com/t/how-to-sprint-only-forward/478288/3 "2021-02-05T17:57:11Z")

</div>

you see what you are doing on w being pressed? do that on input action sprint too, but also, set a bool that overrides what i assume you have for ‘left pressed’ ‘right pressed’ ‘back pressed’ ‘forwards pressed’ etc.

use branch node to avoid doing the settings when this value is true, and lets call it bIsSprinting

then enable bIsSprinting on pressed, and disable it on released, as well as doing the ‘forward pressed’ changes that the w key handler is already doing

---

<div class="post-metadata">

**Author:** ![BronzeBeetle](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BronzeBeetle](https://forums.unrealengine.com/u/BronzeBeetle)\
**Post date:** [February 5, 2021, 6:49pm UTC](https://forums.unrealengine.com/t/how-to-sprint-only-forward/478288/4 "2021-02-05T18:49:52Z")

</div>

Thanks for the replies guys, I found the solution for it and it’s exactly what I want it to do. Here’s the blueprint for those who are finding the solution as well.

 ![328960-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/c/1/bc1301b150163c43eb15408aa9d4933b35c2b09f.png)

---

<div class="post-metadata">

**Author:** ![Pokenic99](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pokenic99](https://forums.unrealengine.com/u/Pokenic99)\
**Post date:** [March 21, 2022, 10:43pm UTC](https://forums.unrealengine.com/t/how-to-sprint-only-forward/478288/6 "2022-03-21T22:43:57Z")

</div>

Hey!

I know it’s to late, but I had the same question and I just find a solution!

 ![Running-Forward](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/f/2/df24585c886549856e6df1c24a50a69a115284ad.jpeg)

No strange bool, just an AND that detected if The command for sprinting (Pressed = Is A) and the walk forward (Axis \>= 1) are pressed in the same time.

---

<div class="post-metadata">

**Author:** ![BigBacon29](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BigBacon29](https://forums.unrealengine.com/u/BigBacon29)\
**Post date:** [July 21, 2024, 1:11pm UTC](https://forums.unrealengine.com/t/how-to-sprint-only-forward/478288/7 "2024-07-21T13:11:42Z")

</div>

I know this is an old post but an easy way to handle this is to simply set a variable, lets call it ‘Y Direction’, from your forward/backward input, then check if its greater than 0 when the player attempts to sprint.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/7/8/d78875002c2ead08d13523d6ad3e586fda9818b6.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/5/d/55d04bb5557078a09592f6a8f9b01b34aca9d164.png)
