How to write a smooth crouching script in blueprint?

Hi elpresidenteffg,

Here is the solution that I came up with for smooth crouching. I am using the First Person Template. If you are using the 3rd Person Template it will require some additional steps to add the crouching animations in.

  • Create a variable to hold the CameraLocation and set it in the construction script or OnBeginPlay in the Event Graph.

  • Add an InputAction for crouching (mine is LeftShift).

  • Create a variable for ‘IsCrouching?’ This will help if you decide to add in a sprint or something at a later date.