Player getting boosted when dashing on edge

I am making a dash system where the player presses a button and moves him forward, but when the player dashes on the edge of something he gets boosted (he moves forward more than he should).
I tried two things but none of them work:

-- get the loock vector
local hrp = script.Parent.HumanoidRootPart
local p1 = hrp.Position
wait(0.05)
local lookVector = CFrame.new(p1, hrp.Position).LookVector

-- way 1:
self.hrp.Velocity = self.DashSpeed*(lookVector * Vector3.new(1,0,1)).unit;

-- way 2:
local BV = Instance.new("BodyVelocity")
BV.MaxForce = Vector3.new(5e4, 5e2, 5e4)
BV.Velocity = lookVector * 200
BV.Parent = hrp
game.Debris:AddItem(BV, 0.2)

VBD9ABDC5F7A58AFDD13F5102AF6486BB072A6F

I think that the humanoid doesn’t have anything to provide friction, so the character is just drifting through the air much further after the boost. You could try stopping or slowing down the character right after the intended boost. Maybe set the HumanoidRootPart’s velocity equal to the moveDirection*Humanoid.WalkSpeed right after destroying the BV.

1 Like

leave it like that, looks realistic (in my opinion)

1 Like