Head follows camera issue

head follows camera issue

local connection
local neck:Motor6D = game.Players.LocalPlayer.Character.Torso:WaitForChild("Neck")
local camera:Camera = game.Workspace.CurrentCamera
connection = game:GetService("RunService").RenderStepped:Connect(function(delta)
	neck.C1 =  CFrame.Angles(math.rad(-90), math.atan2(camera.CFrame.LookVector.X, camera.CFrame.LookVector.Z) + math.rad(-180), 0)*CFrame.new(0,-0.5,0) 
end)
3 Likes

Hello! you are constantly multiplying by -90 radians at CFrame.Angles(math.rad(-90) forcing your character’s head to constantly point up, if you want me to make you a quick solution I can! just let me know!

1 Like

that is not what the problem is
rather whenever i move my camera, rather than it changes y axis it changes x axis

So just to be sure, you want that when the camera rotates on the X axis, you want your head to rotate on the Y axis?

yeah, however it rotates the head at the X axis

Hi! If you wanted to change the rotation over the Y axis via the values of X and Z, you’d need to replace the math.rad(-90) with what you put in the position of ry and multiply the entire thing by CFrame.Angles(math.rad(-90)) if you want an example I can give it but I recommend trying it yourself and contacting me if you have any issues or problems.

1 Like

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