How To Crouch In Unreal Engine 5.2+

There are some steps to implement crouching in UE5. I tried it in C++ but realized that almost everything that we need is already implemented. So, here are simple steps to do it:

  1. Because UE5 has Input Actions instead of binding how it was in UE4, it looks like it has a lot of benefits for future development. Let’s go to{Project folder}\Content\ThirdPerson\Input\Actions
    And click Add button to create Input Action, name could be “IA_Crouch“:

2. Now let’s go one folder up and find there “IMC_Default”, which is Input Mapping Context. There you need to click the button Create Mupping (+) and choose in the dropdown list your new input action. In the end, you will see something like that:

3. Expand your new mapping, and set the correct button for action. For me, it is a classic Ctrl button.

4. Now, it will be the big part where we are working with the character blueprint. For me, it is BP_ThirdPersonCharacter in {Project folder}\Content\ThirdPerson\Blueprints. Let’s open it and select Character Movement in the Components tab.

5. Here, you will see that the Details tab will be changed. Type in a search on this tab word crouch and check the checkmark Can Crouch is checked.

6. Perfect, now we can implement some logic. First, we have to map our Input Action with the correct methods from the code. For that, we should add on Event Graff the EnhancedInputAction IA_Crouch. And two functions: Crouch and Un Crouch. Don’t forget to connect them like that:

7. Now, we have to connect our actions with animations. For it open Animation blueprint, for me it is {Project folder}\Content\Characters\Mannequins\Animations and file ABP_Manny.uasset. And add next:

Please, do not forget to make it beautiful, and combine it in a box. 🙂

8. And we came to the next part, which is set animations on the action! WOW! For that, – open Locomotion in AnimGraph, add one more state Crouch

9. In this step I’ll show you what should be inside Crouch step:

What can we see here: if the speed is 0 – we use animation Idle, and in different cases – Walk. This makes sense because you should not move when you sit and wait.

10. Now, I’m going to show you the conditions which we need for each animation.

Idle to Crouch:

Walk/run to Crouch:

But what about Crouch to Idle and Walk/Run – here is a tricky case. You should check one checkmark Automatic Rule Based on Sequence Player in State in the details tab, and that’s it, the engine will make all things for you:

Thats it!

If you are looking for help, please join Discord.