You can extract the Y rotation of the head, and use it to create a new cframe without any other rotation. This is pretty much how im doing it in my game.
local Head = workspace.Head
local Torso = workspace.Torso
game["Run Service"].Heartbeat:Connect(function()
local _, Y, _ = Head.CFrame:ToOrientation()
Torso.CFrame = CFrame.new(Head.Position + Vector3.new(0, -2, 0)) * CFrame.Angles(0, Y, 0)
end)
hi! i dont know exactly what you want to acheive, but wouldnt you want the torso to be independent from the head? if the user turns the head, the torso shouldnt move according to my preferences, but its up to you. however if youve decided that you do want to make move with the head, you could create a function that updates the torso and bind it to renderstep. ex:
local function updateTorso()
torso.CFrame = CFrame.LookAt(torso.Position, torso.Position + head.CFrame. LookVector)
end
game:GetService("RunService"):BindToRenderStep("torsoUpdate", 1, updateTorso)