Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

making character rotate correctly with slope?

Asked by 4 years ago

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
0
is there a error? Eric_pokemon 133 — 4y
0
no WerewolfCanPoition88 59 — 4y
0
i dont know how to fix the rotation if the characters rotation isnt a part of motor 6d WerewolfCanPoition88 59 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

link to discord post

Ad

Answer this question