Download

Simple Crouch and Slides with blueprint.

Hi, I’ve seen a few posts on here asking how to set up a crouch / slide. I’ve been able to set a simple system today so I thought I would share my method, and you guys could improve your systems from that if you need.

Here is the link to a video showing the result
https://youtu.be/2qvDZVWbsR0

Here are the images you can follow.

Step 1: Set up a crouch
Set up a key to enable crouching. I personally like to toggle my crouch so I don’t have to hold down the key. The ‘doN’ and ‘Switch Int’ Allow me to do this.
Make sure you set up a variable to control your speed if you want the character to move slower when in a crouch. You can use max walk speed for that. I set a Is Crouching Variable to bring into my anim graph as a new locomotion state.
The important part here is to set the blue nodes called ‘crouch’ and ‘uncrouch’ this makes your character capsule smaller so you can fit into holes. If you don’t set this up, your collision will stay the same way as when you are standing. If all you want it to crouch, then you are done.

Step2: set up a slide.
This is a bit more complicated, but not much.
Here you need to make a custom event (mapped to what ever you like) mine is mapped to my dodge button where when you sprint, dodge turns into sliding.
Don’t get all confused with the extra conditions in the branches, i need those because I have attacks set up. You can see and anti spam set-up I made, I did this because if you press the roll button a lot, you will glitch and start flying LOL. Here also you will need to attach the ‘crouch’ node so that the character capsule is small enough to slide under obstacles. The way I set it up for sliding, I used an anim montage and I use a system for launching the character. You see this with the ‘launch force’ and ‘jump force’. those are two variable I use connected to my montage. I have a launch event with the variables that I can plug into an animation with a notify.

This is the launch character setup I use.

and how it is connected in the anim graph is pretty simple.

I hope this is clear enough. Its the first time I try to explain something on here.
You can ask me questions if things are not clear, I will try to answer the best I can.

Hey man sweet blueprint it gave me a good idea of what I should do to start a simple crouch:). I didnt know there was a baked crouch function in unreal…knowing this solved alot of my problems. One question for ya, for your sliding, i noticed that you set an animation montage with “att montage” under the slide if sprinting section. I’m not exactly sure how you did that maybe you can clarify this confusion for me? I would really appreciate it.

First how did you set the att montage? and how did you get that value for Play AnimMontage under Anim Montage?

Hi, the animation montage is looping and it dont stop, can you help?

Hi. Can you try to make a blueprint for the dodge only. Thank you.

Hey I was just wondering, I don’t really understand how you set up the notify event? Could you please explain that more in detail?

Lmao I know that this post is like 4 years old but still xD

Thanks in advance!