Character bouncing off slopes

I’m having a weird problem where if you ever wanted to run up a slope at high speed, it would somehow bounce you off.

What I want to do is make the character run up slope smoothly and stop this weird thing that if you try to jump while running up slope, it stops you and bounce you off.

As you know, Speed Run 4: https://www.roblox.com/games/183364845/MOON-Speed-Run-4 was able to accomplish this by using HipHeight, BodyForce & BodyGyro inside of a “Intense Custom Physics Script”

I’ve tried coding it but I honestly have no clue how they was able to make this. Any ideas on how it was coded?

Btw Here’s my current script:

--Variables--
local char = game:GetService("Players").LocalPlayer.Character or game:GetService("Players").LocalPlayer.CharacterAdded:Wait()
local Torso, rootPart = char:WaitForChild("Torso"), char:WaitForChild("HumanoidRootPart")
local params = RaycastParams.new()
local Humanoid = char.Humanoid
params.FilterDescendantsInstances = {char}
params.FilterType = Enum.RaycastFilterType.Blacklist
--End--

--Code--
game:GetService("RunService").RenderStepped:Connect(function()
	local direction = char.PrimaryPart.CFrame.LookVector*10 -- The direction that character is moving
	char.PrimaryPart.Velocity += direction
	local ray = workspace:Raycast(rootPart.Position, Vector3.new(0, -Humanoid.HipHeight - 1.8, 0), params) -- Checking if it's (char) running up slope
	if ray then
		local bodyForce = Instance.new("BodyForce")
		bodyForce.Parent = rootPart
		bodyForce.Force = Vector3.new(0,game.Workspace.Gravity*rootPart:GetMass(),0)
		Humanoid.HipHeight = 4.86 -- Making the character go up faster
		wait(.1)
		bodyForce:Destroy()
		Humanoid.HipHeight = 0
	end
end)