Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Lock First Person?

I've tried many methods,

local plr = game.Players.LocalPlayer
local cam = game.Workspace.CurrentCamera
local chr = nil

chr = character
plr.CameraMode = 1

while false do
wait ()
cam.CameraType = 0
cam.CoordinateFrame = CFrame.new (200,10,0)
cam.Focus = CFrame.new (200,7,500)
cam.FieldOfView = 20
end

and even

Game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson

But the first method makes it glitchy while the second method doesn't work online. Why?

3 answers

✓ Accepted answer

Well if your trying to find a Working one for Studio and Online here you go!

game.Players.PlayerAdded:connect(function(plr)
    plr.CharacterAdded:connect(function(char)
        if plr and char then
            plr.CameraMaxZoomDistance = 0.5
            plr.CameraMinZoomDistance = 0.5
        end
    end)
end)

Make sure you use a Script

1 comment

0

Enjoy

Not sure why it wouldn't work. BUT you can do a

while wait() do -- Which keeps looping really fast
game.Players.LocalPlayer.CameraType = "LockFirstPerson" --That may not be how it's spelt, But that should work.
end

5 comments

0

It's still glitchy, though.

0

No need for a while loop. Just put "game.Players.LocalPlayer.CameraType = 'LockFirstPerson'" inside a LocalScript inside StarterGui.

0

That doesn't always work. Roblox gets glitchy and doesnt run the line always.

0

It works, but like the mouse like spazzes out.

0

The mouse moves a little when in first person mode, but there's no way for anyone to fix that.

This discussion is preserved as it was. New answers, comments, and votes are closed.