Im using an R6 character and I am trying to make a script that rotates the players head in the direction of the camera. I have it working on the X axis aka looking up and down but I cant get the rotation working for looking side to side.
Heres my code
Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.Angles(math.asin(Camera.CFrame.LookVector.Y) + math.pi/2, math.pi, math.asin(Camera.CFrame.LookVector.Z) + math.pi/2)
I have attempted the left and right rotation but it is offset.
Heres a gif https://gyazo.com/1fcd7d9918006be5cf5f191d353c1085
Thank you for your time :)