i am trying to make the torso bend when the player looks up or down
i have seen some other posts but it wont work with r6
edit:
i have this
local HRP = Character:WaitForChild("HumanoidRootPart")
local Neck = HRP:FindFirstChildOfClass("Motor6D")
local YOS = Neck.C0.Y
local asin = math.asin
local CFNew, CFAng = CFrame.new, CFrame.Angles
RS.RenderStepped:Connect(function()
local Direction = HRP.CFrame:toObjectSpace(Camera.CFrame).lookVector
if Neck then
if Humanoid.RigType == Enum.HumanoidRigType.R15 then
Neck.C0 = CFrame.new(0, YOS, 0) * CFrame.Angles(0, -math.asin(Direction.x), 0) * CFrame.Angles(math.asin(Direction.y), 0, 0)
elseif Humanoid.RigType == Enum.HumanoidRigType.R6 then
Neck.C0 = CFNew(0, YOS, 0) * CFAng(3 * math.pi/2, 0, math.pi) * CFAng(0, 0, -asin(Direction.x)) * CFAng(-asin(Direction.y), 0, 0)
end
end
end)
but it moves my character about randomly over the place