So I'm trying to make a gravity game where the camera is always attached to the players head, even if upside-down. I've tried this code just for the movement of the camera (will add angles later) but it does not attach to the head as required.
local campart = workspace.CameraPart local player = game.Players.LocalPlayer local torso = player.Character.Head local offsetCFrame = Vector3.new(7, 0, 0) latch.CFrame = torso.CFrame:ToWorldSpace(offsetCFrame)
The code needs to just 'weld' the camera to the player's head with an offset of about 7 studs. If anyone can help I would be very grateful. And if you don't understand something, comment about it and I will clarify.
Constantly set the CFrame ok good thanks
local Camera = workspace.CurrentCamera local p = game:GetService("Players").LocalPlayer game:GetService("RunService").RenderStepped:Connect(function() if p.Character then local Attach = p.Character:FindFirstChild("Head") if Attach then Camera.CFrame = Attach.CFrame end end end)
Give upvote