How do i stop bodyvelocity from flinging the player?

is there a way to stop bodyvelocity from flinging the player on contact with an object? ill put my dash mechanic:

local slide = Instance.new(“BodyVelocity”)
slide.Name = “SlideBodyVelocity”
slide.MaxForce = Vector3.new(10000,0,10000)
slide.Velocity = root.CFrame.LookVector * 70
slide.Parent = root

RS.Sounds.SlideSound:Play()

for count = 1, 8 do
	wait(.1)
	slide.Velocity *= 0.8
end

slideAnim:Stop(0.25)

if slide then
	slide:Destroy()
end

I cant change to linearvelocity or any other object.

Could you show an example of the contact flinging the player, there shouldn’t be anything wrong with the script itself, as a note however, you should use task.wait() rather than wait() because its now a deprecated method. BodyVelocity is also deprecated, that could be an issue, try switching to VectorForce, it’s somewhat the same thing. If you’re unable to change to linear velocity then you could always raycast in the LookVector direction of the root part and if an instance is signaled then destroy the force(or incrementally greatly reduce it) and cleanup the raycast connections etc…

1 Like