Sprint and Smooth Crouch Setup UE4 (Less Than 4 Minutes)

5,686
0
Published 2020-11-18

All Comments (11)
  • @joeychimney
    Hi Everyone! Since Ive made this tutorial I have been getting comments asking about how to stop your character from uncrouching into a solid object if there is an object above you when you are uncrouching. One Solution I have found is to add a socket to the character you are using a little above head height, and then draw a sphere trace at that socket when you are trying to uncrouch in order to check if there is something blocking you from standing. (this sets a "CanStand?" Bool variable which you will make.) The sphere trace is set up with a sequence node, so first it traces the sphere, and then it sets a vector variable which saves the sockets location. by the time it repeats the first step of the sequence, the variable you just set is no longer accurate, but what happens is you get the new location directly as the start point of the sphere trace, and then the variable you just set as the end point. This effectively has the sphere trace follow the socket as it moves. If there is something blocking you when you are trying to stand you will remain in a crouched position, and then when you are no longer blocked by something above you, you will stand if you hit the crouch button again. (pretty much temporarily makes crouch toggleable) There is also a "crouchable" bool that is set to check and make sure that your character doesnt sink through the floor by hitting the crouch button when you are already crouched. I have the sphere trace set up with a tick event just for testing, but you can set this up in a different way like with a timer or something in order to save performance. Sphere trace: i.imgur.com/ZICNx3g.png Left CTRL crouch event: i.imgur.com/p983WEz.png And this is what is looks like working (I left the sphere trace debug mode on so u can see what is actually happening): gfycat.com/selfreliantunitedeel
  • One problem with this crouching system is that it does not block the player when going through a crouchable area. If you uncrouch you simply get stuck in the geometry.
  • I didn't get why you would use the Relative Locations vectors, as in my program, using it just made my character go under the floor while removing it, it worked smoothly... Any ideas ?
  • @farasapt6579
    camera shake option didnt appear for me. just the cameramodifier_camera shake.
  • @virusocyrus
    i really need to know how to keep my character from standing whenever its under something. PLEASE HELP
  • @MorganFuse
    Thanks. My problem, is that my character can't go under low surfaces while crouching. Even though he should be. Is there any solution to that?
  • @GamercastMMs
    Love this video, a question though. Why do I go under the floor when crouching? I keep sinking when holding down ctrl for crouching Edit::: My character shrinks and upon releasing my CTRL, it won't stand up again.