How do I make player stick to part?

Hello, I’m currently making this like Mario Galaxy game where your on a planet. Issue is when you go around the sphere you just fall like normal LOL. What I have right now is just a script that rotates the player character to the angles of the “Ball” part. Is there a way I can just make the player be able to walk all around it? video

CODE:

--// Local Script \\--
local char = game:GetService("Players").LocalPlayer.Character or game:GetService("Players").LocalPlayer.CharacterAdded:Wait()
local HRP = char:WaitForChild("HumanoidRootPart")

while game:GetService("RunService").Heartbeat:Wait() do
	local r = Ray.new(HRP.Position, Vector3.new(0,-(char.Humanoid.HipHeight + 4),0))
	local _,_,n = workspace:FindPartOnRayWithIgnoreList(r,{char})
	local vector = (HRP.CFrame - HRP.CFrame.p):VectorToObjectSpace(n)
	if vector.Z > 0 then
		HRP.RootJoint.C0 = CFrame.new(0,vector.z * 1.25,0,-1,0,0,0,0,1,0,1,0) * CFrame.Angles(-vector.z,0,-vector.x)
	else
		HRP.RootJoint.C0 = CFrame.new(0,-vector.z * 1.25,0,-1,0,0,0,0,1,0,1,0) * CFrame.Angles(-vector.z,0,-vector.x)
	end
end

What if you just rotate the part, give a player a walking animation but it won’t actually be walking?

Try the Search tool up top, it’s your friend in situations like this:

Make players walk on Sphere/Planets (Character orbital movement)

Planet Gravity Help