How do i make a bone face the way the camera facing

im not asking for full code im just looking for a place to start. I am struggling to make this work.

my code is referenced from Need help with torso and head following mouse - #7 by CleverSource

my current code:

local function updateHead()
	local change = hrp.Body.Torso.OtherTorso.StartNeck.Neck
	local lookvector = workspace.CurrentCamera.CFrame.LookVector	
	local origin = change.WorldCFrame
	local originPos = origin.Position
	local point = change.WorldCFrame.Position + lookvector
	local dist = (change.WorldCFrame.Position - point).Magnitude
	local diff = change.WorldCFrame.Y - point.Y
	
	change.WorldCFrame:Lerp(origin * CFrame.Angles(-(math.atan(diff / dist) * 0.5), (((originPos - point).Unit):Cross(lookvector)).Y * 1, 0), 0.5 / 2)
	print(point)
end
4 Likes