# Sprinting when crouched

**URL:** <https://forums.unrealengine.com/t/sprinting-when-crouched/1887870>\
**Category:** Blueprint\
**Tags:** unreal-engine, question, Blueprint\
**Created:** [June 3, 2024, 6:48pm UTC](https://forums.unrealengine.com/t/sprinting-when-crouched/1887870 "2024-06-03T18:48:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xYuujii](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xYuujii](https://forums.unrealengine.com/u/xYuujii)\
**Post date:** [June 3, 2024, 6:48pm UTC](https://forums.unrealengine.com/t/sprinting-when-crouched/1887870/1 "2024-06-03T18:48:44Z")

</div>

Hello there,

I am new to unreal engine and I am experimenting with blueprints.  
I made a toggle crouch function. When I toggle crouch, so I am crouching now, and I press sprint when I am stilled crouched, I uncrouch and sprint. But when i try to toggle crouch again it doesn’t. I have to press it twice to get it to toggle crouch again.

What am I doing wrong here?

 ![image_2024-06-03_192832822](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/7/a/e7a6988a6fd034573a70349d7d730126216dd8ab.png)

---

<div class="post-metadata">

**Author:** ![Nightwolf](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nightwolf/32/917179_2.png) [@Nightwolf](https://forums.unrealengine.com/u/Nightwolf)\
**Post date:** [June 3, 2024, 6:59pm UTC](https://forums.unrealengine.com/t/sprinting-when-crouched/1887870/2 "2024-06-03T18:59:24Z")

</div>

Seems like you have two crouches “Crouch\_Toggle” and “Crouch” this may be causing a problem of some kind but that out of the way  
You want to look at the InputMapping it should be in FirstPerson/Input Folder or ThirdPerson/Input

if your using 3rd you want to look at the Input action  
 ![Screenshot 2024-06-03 135625](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/1/5/f15b0e18154146b4dc86e20c72c8111545addb5f.png)  
That will look something like this when you open it up

 ![Screenshot 2024-06-03 135723](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/8/6/08607a8354cd92a7caee4d04e7f25d24c0e02b76.png)  
what your looking for is the trigger you’ll want to add one and test out how it works

hint try dragging a line out from the Canceled execution pin as well

---

<div class="post-metadata">

**Author:** ![Nightwolf](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nightwolf/32/917179_2.png) [@Nightwolf](https://forums.unrealengine.com/u/Nightwolf)\
**Post date:** [June 3, 2024, 7:09pm UTC](https://forums.unrealengine.com/t/sprinting-when-crouched/1887870/3 "2024-06-03T19:09:03Z")

</div>

My ones a bit of a mess i have to clean it up still and forgot so thanks for the accidental reminder

 ![Screenshot 2024-06-03 140234](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/5/5/25505d6cfa55842267083e0b5a955b74938fc2d2.png)

My one at the moment just slows you down when aiming down sights ( ADS ) or when im out of stamina my stamina system sets Can Sprint

![Screenshot 2024-06-03 140714](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/5/2/452471c3d5dd191ff2ba56816a6c5c9eac525c45.png)  
And so does my crouch… tho i plan to move this to its own variable so they never get mixed… say my stamina fills up while im still crouched and it says i can run again, i know need a check either on the stamina system or the crouch

Note the Cancel execution and lack of flip flop, you could use the flip flop but it’ll always cause weird behavior

---

<div class="post-metadata">

**Author:** ![Mind-Brain](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mind-brain/32/906573_2.png) [@Mind-Brain](https://forums.unrealengine.com/u/Mind-Brain)\
**Post date:** [June 3, 2024, 7:28pm UTC](https://forums.unrealengine.com/t/sprinting-when-crouched/1887870/4 "2024-06-03T19:28:19Z")

</div>

Hey @xYuujii! Welcome to the forums!

It’s because your IA\_Crouch\_Toggle event is running on a Flip Flop. When you sprint, it sets IsCrouching? to False, which is great. However, the Flip Flop is not triggered, so it’s still going to take the B path before you can activate the A path again.

Take out the flip flop and replace it with a branch!  
Use IsCrouching? as the input for the branch, on False use the Crouch path and on True use the UnCrouch path! 🙂

Also, Nightwolf’s suggestions of the Input Actions is a good thing to note, as well. You don’t really need more than one here, you can probably get rid of IA\_Crouch completely and use a single Input Action with multiple input styles as shown above!

Let us know if you need more assistance!
