I tried it doesn't work, It only moves the head, Not the rotation, Please help My Code:
local Mouse = game.Players.LocalPlayer:GetMouse() local Motor = script.Parent:WaitForChild("Torso"):WaitForChild("Neck") while true do wait() Motor.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0) + Mouse.Hit.LookVector end
I think this should work, this is Code I found some time ago. It was originally written to rotate entire character so I changed it for only head, so I don't know how it will work
local player = game.Players.LocalPlayer local UserInputService = game:GetService("UserInputService") local mouse = player:GetMouse() local character = player.Character or player.CharacterAdded:wait() local Head= character:WaitForChild("Head") character:WaitForChild("Humanoid").AutoRotate = false local gyro = Instance.new("BodyGyro",Head) UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter gyro .MaxTorque = Vector3.new(math.huge,math.huge,math.huge) gyro .P = 10000 game:GetService("RunService"):BindToRenderStep( "Updategyro ", Enum.RenderPriority.Character.Value, function() gyro .CFrame = CFrame.Angles( 0, math.atan2( Head.CFrame.X-mouse.Hit.X, Head.CFrame.Z-mouse.Hit.Z ), 0 ) end) game:GetService("RunService"):BindToRenderStep( "UpdateNeckC1", Enum.RenderPriority.Character.Value, function() character.UpperTorso.BodyFrontAttachment.CFrame = CFrame.new(0,-0.5,0,-1,0,0,0,0,1,0,1,-0) *CFrame.Angles( -math.atan2( character.UpperTorso.BodyFrontAttachment.CFrame.Position.Y-mouse.Hit.Y, math.sqrt((character.Head.CFrame.X-mouse.Hit.X)^2+(character.Head.CFrame.Z-mouse.Hit.Z)^2) --Distance formula ), 0, 0 ) end)