Camera type won't change

I am trying to make a first person game, and in the menu I would like the player to be standing right at the start, so when they press play it puts them in exactly where the menu took place. I don’t want the player’s camera to be able to move while they are in the menu, and in order to do this I am setting the camera type to scriptable when they join. It is not working though, here is the code:

local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera:GetPropertyChangedSignal("CameraType"):Wait()  --This part waits for the player to be fully loaded if they aren't already
camera.CameraType = Enum.CameraType.Scriptable

How can I make this work?
(It is a LocalScript in Workspace)

1 Like

put the local script in starter player scripts

Capture

and it should work

local camera = game.Workspace.CurrentCamera
task.wait(5)
camera.CameraType = Enum.CameraType.Scriptable

and then to set the camera back to the player you just set the custom

camera.CameraType = Enum.CameraType.Custom
2 Likes

This works for changing the camera type, but while waiting to change it, the player can move the camera. I tried bringing the ‘wait()’ down, but then it stopped working

try this

the code will run until the camera type is set

local Player = game:GetService("Players").LocalPlayer
local camera = workspace.CurrentCamera

repeat wait()
	camera.CameraType = Enum.CameraType.Scriptable
until camera.CameraType == Enum.CameraType.Scriptable

I tested it and it worked for me

2 Likes

just set the camera to FIXED. When you set it to scriptable, you need to set it to a CFRAME for it to have that effect. however, if you just make it fixed, it will stop the player from moving the camera

I don’t think you can use player added in a local script

1 Like

yeah i just realised that. I changed the response to something that should work though

1 Like

This worked for me, don’t worry, and thank you both for trying to help!

2 Likes