wait(1)
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local character = plr.Character
local Neck = character:WaitForChild("Head").Neck
local Head = character:WaitForChild("Head")
local Offset = Neck.C0.Y
local origin = Neck.C0
wait(1)
mouse.Move:Connect(function()
local point = mouse.Hit
--local object_horizontal = Head.CFrame:PointToObjectSpace(point.p) -- Angle beetween mouse, it's for previous tests
--local yaw = math.atan2(-object_horizontal.X,-object_horizontal.Z)
Neck.C0 = CFrame.new(0,Offset,0) * CFrame.Angles(0,math.asin(mouse.Hit.LookVector.X),0)
end)
-- LocalScript in StarterCharacterScripts
script.Parent:WaitForChild("HumanoidRootPart").CFrame:ToObjectSpace(game.Players.LocalPlayer:GetMouse().Hit).LookVector
-- Calculation to make the lookvector relative.
It worked!!!, perfect! you are nice scripter. I have problem with understanding simple things, you know. Sometimes i need to concentrate on smaller things to make bigger one