Running up smoothly a steep ramp/wedge, but it's not working

This question has sort of been answered by another user on the forums, but it’s very hard to understand.

Basically, I have a problem where; when you have a walking speed of 90, (high walking speed in general) you sort of start switching between two states: climbing and running, but there’s a possible fix for that if you do character.Humanoid:SetStateEnabled(12,false)

But if you do it like that, you can run up and down the wedges pretty smoothly, but when it comes to jumping and running you start sliding to the left and lose control for a few seconds before you start to run again.

I don’t want to use that line of code, I want to be able to jump. Therefore I have another piece of code which is supposed to fix all that, but it doesn’t work for some reason. When I run up the ramp/wedge I sort of lag or what should I call it, you run slow, and the screen like shakes.

Here’s an example of it happening:

https://gyazo.com/11490f0415a004f11495816c966baff7

It doesn’t look smooth at all compared to speed run 4.

Current code
game:GetService("RunService").RenderStepped:Connect(function()
	local part, intersectionPoint, surfaceNormal = workspace:FindPartOnRayWithIgnoreList(
		Ray.new(character.HumanoidRootPart.Position, character.Humanoid.MoveDirection * 50),
		{ character }
	)

	local upVector = surfaceNormal:Cross(character.HumanoidRootPart.CFrame.rightVector)
	local upVector2 = surfaceNormal:Cross(upVector)
	
	bodyForce.Force = hrp.CFrame:vectorToWorldSpace(surfaceNormal) * 9.81 * characterMass
	--bodyGyro.CFrame = CFrame.new(Vector3.new(), part.CFrame.lookVector)
end)
2 Likes

Have you tried making the player float up from the ground a bit so that the player doesnt get shoved into the slope when you have bodyforce? (kinda like how you did hipheight but dont use that)

Edit: Also, If you want to jump, I think you can just see when the player uses the jump key and add bodyforce to the player to force the player up.