Accurate first person looking system

Hello, I’ve recently been trying to make a good system which makes the character look at where the camera is looking.
While I know how to make the characters head follow the camera, there’s one thing I’m having trouble with.
I’m trying to make this system for first person, when I look around in first person the system would make the head look up and down, but the rest of the body would follow the head looking left and right

In short, I want the rest of the body to stay in the same orientation until the player looks too much to the left or right.

Both references are made from regretevator

Any help is appreciated.

You didn’t include any code for us to review so we have no idea why your code isn’t working. What do you have currently?

local cam = workspace.CurrentCamera

local plr = game.Players.LocalPlayer

local char = plr.Character or plr.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")

local neck = char:FindFirstChild("Neck", true)

local y = neck.C0.Y


game:GetService("RunService").RenderStepped:Connect(function()
		
	if neck then
		
		local camDirection = hrp.CFrame:ToObjectSpace(cam.CFrame).LookVector
			
		neck.C0 = CFrame.new(0, y, 0) * CFrame.Angles(0, -camDirection.X, 0) * CFrame.Angles(camDirection.Y, 0, 0)
	end
end)

This is a localscript in starterplayerscripts

I just found out about Humanoid’s autorotate which does exactly what im looking for.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.