#How do people make their sliding/crouching system

1 messages · Page 1 of 1 (latest)

tulip mica
#

I'm making a crouching/sliding system and wondering how people deal with collisions due to the change in height
one solution would be to change the hipheight which can be reasonable for sliding but for crouching the collisions prevent you from going up-stair like terrain. I could change hipheight only for sliding but I want crouching to allow someone to go through small spaces, plus changing hipheight drastically makes the character all bouncy.

another solution i thought of would be welding a part below the humanoidrootpart and when sliding/crouching is initiated, humanoidrootpart's collision would be turned off for that duration, but I think it'd be even worse for climbing up stairs.

my last solution is a raycast shooting out from both humanoidrootpart and the weld and if it hit's something then change the cancollide for the other piece but that is a tacky solution and i don't like it, haven't tried it though so idk how it would fair with stairs.

true larkBOT
#

studio** You are now Level 2! **studio

lost pelican
#

In Roblox, crouching and sliding systems are mostly about changing the character’s size and movement. For crouching, developers usually lower the character’s hip height or scale their body down, and play a crouch animation so it looks realistic. For sliding, it’s kind of like a dynamic crouch, you check if the player is running and presses the slide button, then temporarily boost their forward speed while keeping them low, often by changing their velocity or applying a force. Once the slide ends, the character goes back to normal height. Good systems also add things like smooth animation transitions, camera effects, or sound effects to make it feel more natural. Basically, it’s a mix of adjusting the character’s collision, movement, and visuals all at once. well thats atleast how i do it...

lofty kestrel
tulip mica
#

the biggest concern was the collisions i guess, for example in the image below i'm doing my crouching animation and without changing the hipheight, and the rootpart is colliding with the obstacle because the root part is too high

tulip mica