Yesterday I posted a question which didn't include any code. [It got moderated] So I took Donut's advice and made my script. In this LocalScript I instantiate a part, weld it to the HumanoidRootPart of the character and offset it to where I want the camera location to be; over the right shoulder.
local cameraPart = Instance.new("Part")
cameraPart.CanCollide = false
cameraPart.Size = Vector3.new(1,1,1)
cameraPart.FrontSurface = Enum.SurfaceType.Hinge
cameraPart.Massless = true
cameraPart.Name = ("CameraPart")
local weldPiece = Instance.new("Weld")
weldPiece.Name = ("CameraWeld")
--Functions
local function weldPartToPlayer(weld,part)
part.Parent = char
weld.Part0 = hrp
weld.Part1 = part
weld.C0 = CFrame.new(offset)*CFrame.Angles(rad(0),rad(0),rad(0))
weld.Parent = hrp
end
weldPartToPlayer(weldPiece,cameraPart)
Then I utilized RunService to make the camera CFrame become the part's CFrame.
Runservice.RenderStepped:Connect(function()
camera.CFrame = cameraPart.CFrame
end)
This works perfectly, but it's not finished. Which leads to my question!
How would I lock the mouse to the center and make Delta.X rotate the HumanoidRootPart left to right?
Thank you very much for reading and any help is appreciated! I'll upvote and accept the answer that works best. c:

1 comment
Perfect, thanks for fixing the question.