I need help figuring out how I can lock a players camera in the mouse lock angle. I made a script that makes you face where your mouse is pointing
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
repeat wait() until player.Character
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
game:GetService("RunService").RenderStepped:connect(function()
if humanoid.Health > 0 then
character.Torso.CFrame = CFrame.new(character.Torso.Position, Vector3.new(mouse.Hit.p.X, character.Torso.Position.Y, mouse.Hit.p.Z))
end
end)
Any help finding out how to make the camera angle stay in the mouse lock angle position?

1 comment
How would I make it possible for the player to move their mouse if needed?