So basically im making a Kart racing game and im trying to make it so the character rotates to the slope its standing on, i already have a ray shooting down so i can get the normal, but my best attempt on doing this works… But only one way… I really want to move on from this problem but I’m awful with cframes.
Heres footage of the problem
And heres my rotation code.
Angle += tGoAng
local targetPosition = plrPart.CFrame.Position + downRay.Normal*2
plrPart.CFrame = CFrame.new(plrPart.CFrame.Position, targetPosition)
local rotatedCFrame = CFrame.Angles(math.rad(-90), Angle, 0)
plrPart.CFrame = plrPart.CFrame:ToWorldSpace(rotatedCFrame)
Somebody please help!