Why doesn't the CameraType change?

  1. What do you want to achieve? A character selection screen

  2. What is the issue? I have two scripts, one that handles the character selection screen and one that handles the camera. The camera script works for setting the CFrame to see the selection area but doesn’t work when I try to set the camera type to custom so the camera follows the player

  3. What solutions have you tried so far? I tried using repeat loops, making it a separate script but nothing has worked

this is the camera script(local, inside of StarterGUI)

local camera = workspace.CurrentCamera
local button = script.Parent.SelectCharacter.SelectButton

repeat wait()
	camera.CameraType = Enum.CameraType.Scriptable
	camera.CFrame = workspace.CameraFocusPart.CFrame
until camera.CFrame == workspace.CameraFocusPart.CFrame

button.MouseButton1Click:Connect(function()
	camera.CameraType = Enum.CameraType.Custom
end)

all help is appreciated

Just copy and pasted your script and it seems to work fine for me. Are there any errors associated with this in the console?

nothing in the console or output. when the CFrame is set the character is tied it’s model, but after the click the character model changes to a different one, could that be causing a problem?

repeat 
	task.wait()
	camera.CameraType = Enum.CameraType.Scriptable
until camera.CameraType == Enum.CameraType.Scriptable
camera.CFrame = workspace.CameraFocusPart.CFrame