Sliding System Glitch

How can I stop the slide before the character hits a part close to the ground? I am raycasting forwards 5 studs, but sometimes small parts on the ground such as a 1 stud tall spawn location are not detected and the character glitches. Any other way to do this?

1 Like

You could create a hitbox when sliding (make sure u make it massless), and have it stop the sliding whenever it detects whatever you’re trying to stop.

How would I detect when the hitbox hits something? I usually avoid .Touched since it’s inaccurate.

1 Like

I usually use .Touched so i’m not sure.

And if i’m correct .touched is mostly inaccurate if you’re just standing there. Considering your player will be sliding and they will be in movement, it should be fine. Make sure to give the hitbox appropriate size though.

Maybe use a bigger raycast? things like shapecast or spherecast can help with bigger area of detections

Use workspace:GetPartsInPart(Part, Op)
Because it already has raycast implemented, so you won’t need to worry about inaccuracy.

1 Like

I’m using a LinearVelocity which somewhat respects physics. However, it ignores gravity sometimes such as going down a hill. How would I allow for it to take gravity into consideration?