Final note, my “can crouch” is checked. I’m still new to all of this and this is really disheartening because i’ve watched 3 different tutorials and it still hasnt worked.
If you edit the capsule so it’s visible, is it shrinking when you crouch?
You need the animations and your state machine in the AnimBP needs to be set up to transition to the crouch animation.
Without this the capsule will collapse, but the mesh will stay in the standing pose anims.
Hi @D_E_S_P_A_I_R ,
Exactly, what’s happening is that you’re only enabling the crouch functionality, but you also need to update the animation. Here’s how to do it:
First, you’ll need to find the animations you want to use for crouching (at the end I’m leaving you where you can download it) and import them into the editor.
Once imported, you can place them in a new folder to keep things organized. Then, follow these steps:
You’ve already assigned the key with the crouch and uncrouch nodes. In the Character Movement component, make sure that Can Crouch is enabled. I recommend setting the Crouched Half Height to around 60. You can make the character capsule visible and adjust the value until it lines up with your crouch animations. Also adjust the max walk speed while crouched so the character moves slower in that state.
Next, go to the Character’s Animation Blueprint.
Create a new boolean variable called IsCrouching, which will let you switch between standing and crouching. In the Event Graph, set this variable
In the Main State Machine, open the Asset Browser at the bottom right, find the animations you want to use
(An important detail: make sure the animation mesh matches your character’s mesh in the Character Blueprint.)
then drag them into the state machine. This creates the states, and then you need to connect them together
In the transition from Crouch to CrouchWalk, double-click it and set the boolean to true (the part marked in yellow)
Do the same for CrouchWalk to Crouch (the part marked in red)
Go back to the main state and create a new state alias called To Crouch and configure it as shown
In the transition from To Crouch to Crouch, set the boolean to true again (the part marked in pink). Then create another state alias called To Stand and connect it to Locomotion with the following configuration
In the transition, set the boolean to not true (same as in CrouchWalk to Crouch)
Finally, to make this animation loop, go to the CrouchWalk State, select the animation, and in the details panel enable the Loop Animation option.
I’m leaving you some documentation that might be useful to you
- Animation Blueprints in Unreal Engine | Unreal Engine 5.0 Documentation | Epic Developer Community
- State Machines in Unreal Engine | Unreal Engine 5.0 Documentation | Epic Developer Community
Also, here’s a link where you can download animations from the Fab
and a video that can be used as a guide which includes the crouch and crouch-walk animations
Hope it helps!