I made head rotating based on mouse position

Hi everyone, today i’m will show you my new system for head rotation , it can be easily transformed to server side, and you can use it when you wan’t i give you script to use it.
here is a video, i have a lot of problems with mouse inverses but now it’s worked perfectly thanks 10kgoldxdrip for helping me fixing bugs.

here is a script, if you wan’t to use it

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 vector = character.HumanoidRootPart.CFrame:ToObjectSpace(point).LookVector
	
	Neck.C0 = CFrame.new(0,Offset,0) * CFrame.Angles(vector.Y,-vector.X,0)
	
	

	
	
	
	
end)

Note: this script is LOCAL! and you can transform it to server

7 Likes

Good. Now I can yoink it! >:).

character limitation.

2 Likes

Would look smoother if you used lerped the value.

1 Like

ehh, this is no lag system soo, it’s smooth enough for that , if you wan’t you can use run service or something like this, but it’s not recommended