Player slides across the surface

Hello! I am making a realistic planetary gravity, using modded Ego Moose’s gravity controller. When trying it out, player is sliding across the surface, which is really annoying, and can barely walk. Here’s the script:

function GetGravityUp(self, oldGravityUp)
	local n = {nil,math.huge}
	for _,planet in pairs(workspace.Planets:GetDescendants()) do
		if planet:FindFirstChild("Center") then
			local p = planet:FindFirstChild("Center")
			local magnitude = (p.Position - PLAYERS.LocalPlayer.Character:FindFirstChild("HumanoidRootPart").Position).Magnitude
			if magnitude <= p.GravRadius.Value then
				n = {p,(p.Size.X)*2}
				script["Current Planet"].Value = p:FindFirstChildWhichIsA("StringValue").Value
			end
		end
	end
	n = n[1]
	if n then
		return CFrame.new(PLAYERS.LocalPlayer.Character.HumanoidRootPart.Position,n.Position).LookVector * -1
	else
		script["Current Planet"].Value = "nothing"
	end
	return oldGravityUp
end
Controller.GetGravityUp = GetGravityUp
PLAYERS.LocalPlayer.Character.Humanoid.Seated:Connect(function(tr)
	if not tr then
		Controller = GravityController.new(PLAYERS.LocalPlayer)
		Controller.GetGravityUp = GetGravityUp
	end
end)
game:GetService('RunService').Stepped:Connect(function()
	if not PLAYERS.LocalPlayer.Character.Humanoid.Sit then
		PLAYERS.LocalPlayer.Character.Humanoid.PlatformStand = true
	end
end)

If you need any more information, let me know. Thanks for help!

1 Like