Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

making character rotate correctly with slope?

so i made this function which should tilt the player to the surface below them, but if you rotate the character it does not rotate it normally, it rotates it in a weird way

function moveSet:setTilt()
	if self.humanoid:GetState() == Enum.HumanoidStateType.Running or self.humanoid:GetState() == Enum.HumanoidStateType.RunningNoPhysics then
		local ray = Ray.new(self.hrp.Position, Vector3.new(0, -3, 0))
		local FloorPart,pos,normal = workspace:FindPartOnRay(ray, self.character)
		if FloorPart then
			self.root.C0 = CFrame.new(Vector3.new(0,0,0),normal) * CFrame.Angles(math.rad(0), math.rad(270), math.rad(90))
		end
	end
end

3 comments

0

is there a error?

0

no

0

i dont know how to fix the rotation if the characters rotation isnt a part of motor 6d

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.