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

Camera mode not locked first person in online mode?

I made a Local Script inside the StarterGui, with the following line inside:

game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
game.StarterGui:SetCoreGuiEnabled("All", false)

The problem is that in online mode, the player is not locked in First Person view, however the 2nd line (game.StarterGui:SetCoreGuiEnabled("All", false)) works just fine. How come in offline mode, the Camera is locked on first person, but on online mode it isnt?

2 answers

✓ Accepted answer

All local scripts generally need a wait() on the very first line and I checked this with your script anyways so....

wait()
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)

It worked in start server so should work in game.

1 comment

0

Also, there are times that even the above may not work, say if a player has a slow computer. If you still have issues at times, think about using WaitForChild() on LocalPlayer -- it works just like FindFirstChild(), but waits until the child named is there rather than erroring.

ROBLOX Camera functions ingame are currently being developed. In come cases you will find your cursor moves around in FPV and ML.

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