Im trying to keep the c amera locked and the mouse locked like if i were like in a turret | NOT WORKING

I want my camera to behave, heres kinda what i want [below]

I CANNOT REPLICATE THIS??? I tried once and it didnt work so i gave up
here my attempt

US.MouseBehavior = Enum.MouseBehavior.LockCenter
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable

runtime.Heartbeat:Connect(function()
			Char.Head.CFrame = CFrame.lookAt(Char.Head.CFrame.Position, player.LocalPlayer:GetMouse().Hit.Position)
			workspace.CurrentCamera.CFrame = Char:FindFirstChild("HumanoidRootPart").CFrame * CFrame.new(0,20,0)
end)

and and heres what it does:

… why is it not locking camera with mouse but i can-
oooh and also icannot move my mouse whilee script runnning

Not sure about not being able to move the mouse; but the camera moving forward could be caused due to Mouse.Hit.Position returning an endpoint of the ray it used to check if the mouse is over anything when the object is really far away or doesn’t exist (hovering over air), resulting in the Mouse.Hit.Position changing as your camera moves.

UserInputService.MouseBehavior = Enum.LockCenter or something

ios donmt know how to dfo itR

broken scrip[t