Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Camera mode not locked first person in online mode?

Asked by 10 years ago

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

Log in to vote
2
Answered by 10 years ago

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.

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. deaththerapy 60 — 10y
Ad
Log in to vote
1
Answered by 10 years ago

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

Answer this question