VectorForce not interacting well with slopes

When I use VectorForce down a slope with a sliding ability, it will kind of bounce awkwardly down a slope rather than sliding down. How do I make it slide down the slope?

Maybe you can alter the MaxForce of the VectorForce to be the bare minimum force required to achieve your goal as to prevent bouncing. Could you also provide a video example?

Could I also see the code, I’m not sure if the issue is in the direction of the vector or something else.

game.ReplicatedStorage.SlideEvent.OnServerEvent:Connect(function(plr)
	
	local char = plr.Character

	local slideforce = Instance.new("VectorForce")
	slideforce.Parent = char.HumanoidRootPart
	slideforce.Attachment0 = char.HumanoidRootPart.RootAttachment
	
	local vel = 50000
	
	local force = Vector3.new(0,0,-1)
	
	slideforce.Force = force * vel
	print(slideforce.Force)
	
	wait(1)
	slideforce:Destroy()
	
end

Firstly the force is sending the player directly forwards and isn’t aligning with the direction of the slope, that could be the issue. Also the velocity variable seems pretty high, I would just multiply force by the HumanoidRootPart’s assembly mass multiplied by another number which would represent speed. Also i would like to see what the slide would look like if you didn’t destroy it the next second and instead after 5.

1 Like

It’s not an error with the code your code is good. It is because the force you’re applying the force away from the slope instead of with it. If you added a downward force as well as the initial force it will be much smoother.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.