Hello, the title might be confusing because I have no idea how to word this but im going for a players character sticking to where the camera is pointing, I have no scripts for this because I have no idea how to pull this off.
RunService.Heartbeat:Connect(function()
if (workspace.CurrentCamera.Position - head.Position).Magnitude < 0.6 then
local currentRotation = workspace.CurrentCamera.CFrame.Rotation
local _, y, _ = currentRotation:ToEulerAnglesXYZ()
local rotation = CFrame.Angles(0, y, 0)
body.CFrame = CFrame.new(body.Position) * rotation
end
end)
first, it checks if the player is in first person (camera is than 0.6 studs away from head)
second it fetches the current rotation of the local player’s camera, third it gets only the Y rotation out of the cameras rotation and then it applies that Y to the body’s Y’s rotation. hope this helped!
The reason the camera is not in the direct center of the head is because Roblox’s minimum camera zoom distance is 0.5. The only way I know to get around this is to edit the player script camera modules. You can’t make the offset exactly zero, but can make it very low.