I’m working on a horror game based on the backrooms. I have the player’s camera set to third person so they can move their mouse around and press GUI buttons. I’m trying to set their camera to first person once the game starts, but any changes I make aren’t happening.
This is the script I’m currently using. It’s a local script.
local Button = game.Players.LocalPlayer.PlayerGui.ScreenGui.OptionYes
local frame = script.Parent
local Audio = game.SoundService.RustyDoor
local function StartNewGame()
game.StarterPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
game.StarterPlayer.CameraMinZoomDistance = 0.5
task.wait(30)
frame.Transparency = 0
Audio:Play()
task.wait(6)
for i = 1, 100, 1 do
frame.Transparency += 0.01
task.wait(0.01)
end
end
Button.MouseButton1Click:Connect(StartNewGame)
I’ve found other topics on this, but they’re confusing and don’t seem to have clear answers.
local Button = game.Players.LocalPlayer.PlayerGui.ScreenGui.OptionYes
local frame = script.Parent
local Audio = game.SoundService.RustyDoor
local camera = workspace.CurrentCamera
local function StartNewGame()
camera.CameraMode = Enum.CameraMode.LockFirstPerson
camera.CameraMinZoomDistance = 0.5
task.wait(30)
frame.Transparency = 0
Audio:Play()
task.wait(6)
for i = 1, 100, 1 do
frame.Transparency += 0.01
task.wait(0.01)
end
end
Button.MouseButton1Click:Connect(StartNewGame)
If you just want to unlock the mouse in first person for x amount of time or for gui then you can do so without changing the camera. Check out these posts:
Although this is already solved, that wouldn’t have worked. No changes were being done. I tried to set the minimum zoom distance to 0.5, but it remained at it’s original value of 5.