BodyMovers experts: BodyVelocity suspending me in the air?

This is a body mover I use for my slide (Crouching while sprinting) and it works nice and well, except it suspends you in the air and makes you not subject to gravity, so if you slide off an edge you’re suspended in the air and can “fly”, but if i add a negative value to the Y value of the velocity, my character glitches around and it causes problems. I just want my character to be subject to gravity

local bodyPos = Instance.new(“BodyVelocity”)
bodyPos.Parent = rootpart
bodyPos.MaxForce = Vector3.new(5000000, 5000000, 5000000)
bodyPos.P = 9000
bodyPos.Velocity = Vector3.new(rootpart.CFrame.lookVector.X, 0, rootpart.CFrame.lookVector.Z).unit * 40
game.Debris:AddItem(bodyPos,0.45)

1 Like

Nevermind, fixed it, I changed MaxForce Y axis to 0

2 Likes

Nevermind, sliding into objects launches me into the air. I want them to have stopping power. Solutions?

Turn it off on collision would be the best.

You are likely tossed so high because you no longer have any force trying to correct Y position but a huge force pushing you forward. You can lower the force.

Generally you only want enough force to do the job and no more. Find what works and add a little for insurance.

You can also use math to find how much force is needed to slide with standard mass/friction on character and a given friction of ground.
That way if you have more mass or the ground is more sticky your slide doesn’t work like in real life.

1 Like