The bouncing issue with sliding mechanic

You can write your topic however you want, but you need to answer these questions:

  1. I’m currently working on a sliding system but the character keeps bouncing and makes it look bad any ideas on how to fix it? (I use bodyvelocity and set the velocity based on the RootPart’s lookvector I’ve tried using LinearVelocity but it didnt fix it)

  2. Heres the gif of the issue https://i.gyazo.com/7df27a61382ea44921e95ff15d65c7b8.mp4

	local GroundSlideVelocity = Instance.new("BodyVelocity")
	Velocity.MaxForce = Vector3.new(25000,0,25000)
	Velocity.Velocity = RootPart.CFrame.LookVector * CurrentSlideSpeed
	Velocity.Parent = RootPart
1 Like

I think that is just roblox physics,if you go fast in slope then you float in air for short time, then you fall and bounce very little.

It might be hard to understand this image.
Explainations
Blue circle : the point ( RootPart )
Blue arrow : lookVector of RootPart (Velocity)
Red line : The way blue circle goes when its applied lookVector velocity
Black line : slope
Mint circles : where bounces happen

1 Like

yes I thought so too, do you have any solutions to this?

Do you have a video of the issue?

Try this system that uses raycasts to make velocity match the slope of the object

while Sliding --[[Variable For Sliding]] do
	local rayParams = RaycastParams.new()
	rayParams.FilterType = Enum.RaycastFilterType.Exclude
	rayParams.FilterDescendantsInstances = {RootPart.Parent}
	local raycast = workspace:Raycast(RootPart.Position, Vector3.new(0,-3.5,0), rayParams)
	local Rotation : CFrame
	if raycast then
		if raycast.Normal ~= Vector3.new(0,1,0) then
			Rotation = CFrame.new(Vector3.zero, raycast.Normal)*CFrame.fromOrientation(math.rad(90),0,0)
		else
			Rotation = RootPart.CFrame.Rotation
		end
	else
		Rotation = RootPart.CFrame.Rotation
	end
	GroundSlideVelocity.Velocity = Rotation.LookVector * CurrentSlideSpeed
	wait()
end

If his idea doesn’t solve the problem, then I have another prompt for the solution:

The bouncing might be due to the character colliding with the ground. When using BodyVelocity, the character’s velocity is changed instantly, which can cause it to collide with the ground and bounce. Like what @TheESPPlayerSeemoney pointed out.

One way to fix this is to use BodyPosition instead of BodyVelocity. BodyPosition moves the character towards a target position smoothly, which can help prevent bouncing.


local GroundSlidePosition = Instance.new("BodyPosition")
GroundSlidePosition.MaxForce = Vector3.new(25000,0,25000)
GroundSlidePosition.Position = RootPart.Position + RootPart.CFrame.LookVector * CurrentSlideSpeed
GroundSlidePosition.Parent = RootPart

This will move the character in the direction it’s looking at a speed determined by CurrentSlideSpeed.

Another thing you can do is to adjust the Friction property of the character’s parts. A higher friction means the player sliding more, and a lower friction means the player sliding less (if that makes any sense).

If this doesn’t solve the problem, then I’m gonna need more details like how CurrentSlideSpeed is calculated.

First off, the BodyVelocity instance is deprecated, and you should use something like a LinearVelocity instead. This video I found talks a bit about this issue with moving down slopes, and the way they fix it is by snapping the player down if the distance is small enough
(They talk about it at time 5:00)

hey, I’ve tried this solution but there is a little bit jiggling still do you have any ideas?

i think you can use linear velocity? or other velocity instances and make the force go down, so it wont bounce


Image explaination:
Black line = slope
Blue circle = the part sliding
Purple arrow = Look Vector (of blue circle)
Green arrow = the velocity of LinearVelocity (Vector3.new(0,-x,0))
Blue arrow = the direction blue circle actually goes when all the forces combined
Red line = The way blue circle goes when its applied lookVector and linearVelocity (0, -x, 0)
( x is unknown, you should adjust it )