Sticking HumanoidRootPart to a Normal

Attempting to get the player to “stick” to the normal of a raycast I use

Video of current system

Current system’s (relevant) code:

-- The raycast
local slideSlope = ws:Raycast(hrp.Position,hrp.CFrame.UpVector*-4,plrBl())

-- The locking system
hrp.CFrame = CFrame.new(hrp.Position)*CFrame.Angles(math.rad(slideSlope.Normal.X),math.rad(slideSlope.Normal.Y+180),math.rad(slideSlope.Normal.Z))

image
found a fix.

hrp.CFrame = CFrame.lookAt(hrp.CFrame.Position,hrp.CFrame.Position+(slideSlope.Normal+Vector3.new(0,-1,0)))
1 Like

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