Why does the CFrame of the camera not change?

1.The script successfully is triggered from the RemoteEvent, and the camera switches to scriptable, but the CFrame doesn’t change

local TS = game:GetService("TweenService")
game.ReplicatedStorage.RemoteEvents.CameraEvent.OnClientEvent:Connect(function()
	local camera = game.Workspace.CurrentCamera
	local function Play(part)
		TS:Create(camera,TweenInfo.new(5,Enum.EasingStyle.Linear,Enum.EasingDirection.Out),{CFrame = part.CFrame}):Play()
		wait(5)
	end
	camera.CameraType = Enum.CameraType.Scriptable
	for _, camerapart in pairs(script.Parent:GetChildren()) do
		if camerapart:IsA("Part") then
			if camerapart.Name == "1" then
				camera.CFrame = camerapart.CFrame
			else
				Play(camerapart)
			end
		end
	end
end)

I think you have to keep setting the camera’s CFrame each frame, not sure though
Try using RunService.RenderStepped

(It is deprecated but it still works, when I tried the new methods in studio they did not work)

how do you use that to do an smooth camera effect, because if I do, do that, the script will be way more complicated then it needs to be

If you don’t want your script to be complicated, try tweening the camera part’s CFrame instead, and then setting the camera’s CFrame to it

I realized the problem was because I was calling StarerGui’s children lol, but that also works