How do i fix this script that makes the camera move to a part?

it says scriptable for the first few seconds then it changed to custom

i can see the part moving

local cam = game.Workspace.CurrentCamera

cam.CameraType = Enum.CameraType.Scriptable
cam:GetPropertyChangedSignal("CameraType"):Wait()
cam.CameraType = Enum.CameraType.Scriptable

local Focal = game.Workspace:WaitForChild("Focal")

while task.wait() do
	cam.CFrame = CFrame.new(Focal.Position, Focal.Position - Vector3.yAxis)
end

My last resort. Try this.

well that didnt work… but i fixed it by just constantly changing the cmaera type every frame.
kinda dumb but it works