I’ve been attempting to get my camera to basically follow my head
It’s very close but there’s one issue with the camera
I can only turn about 70 degrees before my character stops but the camera keeps going
local char = player.Character or player.CharacterAdded:wait()
local humanoid = char:WaitForChild("Humanoid") -- waits for the humanoid in the character
local camera = workspace.CurrentCamera
local root = char:WaitForChild("HumanoidRootPart")
local waist = char:FindFirstChild("Waist", true)
local yOffsetWaist = waist.C0.Y
local CFNew, CFAng, asin = CFrame.new, CFrame.Angles, math.asin
camera.CameraType = Enum.CameraType.Custom
camera.CameraSubject = char.Head
game:GetService("RunService").RenderStepped:Connect(function()
local cameraDirection = root.CFrame:toObjectSpace(camera.CFrame).lookVector
if waist then
waist.C0 = CFNew(0, yOffsetWaist, 0) * CFAng(0, -asin(cameraDirection.x), 0) * CFAng(asin(cameraDirection.y), 0, 0)
end
end)
Video Example