Attach camera to head ragdoll

How can i make camera attach to head and when i ragdoll player camera rotating with head like in ragdoll engine?
Examle:
robloxapp-20240221-1257383.wmv (3.0 MB)

You can use:

game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
game:GetService(“RunService”).RenderStepped:Connect(function()
game.Workspace.CurrentCamera.CFrame = HeadPart.CFrame
end)
– LOCAL SCRIPT

You can also use:

game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom

to reset the camera back to normal

camera cframe just moving with head and not rotating wit camera

you’ll have to recode the camera scripts i think if u want the camera to be able to move