Help with camera in first person

I want my character first person POV to follow the mouse.
like this but in first person:

I’m having problems locking the camera in first person so it just breaks.
I have searched for solutions but I haven’t found anything.

This is the code for the third person that is in the clip:

local Mouse = Player:GetMouse().Hit.Position
local CharacterPosition = Player.Character.HumanoidRootPart.Position
				
local ChartoMouse = (Mouse - CharacterPosition).unit * math.clamp( (Mouse - CharacterPosition).Magnitude , 0, 2)
				
local Lookat = CharacterPosition:Lerp(CharacterPosition+ChartoMouse,0.75)

Camera.CFrame = Camera.CFrame:Lerp(CFrame.new(CharacterPosition + Vector3.new(0, 2, 15),Lookat),0.1)
3 Likes

To do first person you simply do this

local player = game:GetService(“Players”).LocalPlayer
player.CameraMode = Enum.CameraMode.LockFirstPerson

Camera Mode

2 Likes

To elaborate this a bit more, when you put the player in first person it locks the mouse to the middle of the screen. I think when GUI is on the screen it unlocks but im not so sure.

1 Like

I already tried and this happens:

I’ll try thank you :slight_smile:

Omg it works thank you

2 Likes