Crawling Human - Collision

Hello developers,

I’ll cut to the chase; I’m trying to script a crawling sequence. If I simply play the animation, this is the result:
https://gyazo.com/de52aabb62020976a7fddaaa27c9336b.mp4
The mp4 above shows that the camera jumps around a lot as the character’s parts collide with the ground quite a lot.

Here’s what happens if I put the character’s parts (excluding the HumanoidRootPart) inside a non-colliding collision group called “CharacterParts”
https://gyazo.com/970cfcbeefacc5abb75d52511cc214fb.mp4
The character is able to crawl and walk right through walls, however the nasty camera wobbling is gone.

If you know or have an idea as to how I may keep the smoothness of the 2nd mp4, while maintaining collision with objects, please share some tips with me! I’m unsure how I can get to that goal.

1 Like

You could either:

  1. Make a separate collision group and just put the parts you want the character to be able to go through (i.e the floor) so it can’t go through walls.
  2. Just make the animation not go through the ground (Might not look as nice though)
3 Likes

If I remember correctly, the torso or upper torso still have collision turned on and this might be the reason why your character jumps during the animation, since it looks like the upper torso is rotated back and forth and might be pushing the entire character up.

Again I’m not sure if that’s the case, but it’s worth looking into it and try to turn collision off for the upper torso.

1 Like

You could try welding a collider to the character:

Repro.rbxl (42.2 KB)

https://gfycat.com/ComplexSnarlingLeafbird

Notes:

  • The collider has to be named “Torso” because Humanoids are bad and MoveTo only processes collisions for parts named Torso
    • “UpperTorso” works as well, but that would interfere with your actual UpperTorso. If using R15, use Torso; if using R6, use UpperTorso
  • Collider needs to be ~1 stud off the ground because HRP collider that shifts players up wedges/parts still only has a radius of 2.
    • If you can figure out how to dynamically switch out the HRP without killing the character or breaking anything with the Humanoid, you could alternatively add a second collider and set it as the HRP (still need “Torso” or no walking collisions), which may eliminate the need for it to be ~1 stud off the ground
  • Characters will not be able to walk up stairs since the collider gets stuck on the step above
    • If you use collision groups to prevent the collider and stairs from colliding, you should be fine. The HRP’s upward force will keep you colliding with the stairs

There may be some other edge cases, but it should be fine for the most part.

14 Likes