Camera not changing when press gui button

I tried to make it so when you press the play button gui it changes your camera from the main menu to the character but its not working i’ve tried changing the order that didn’t work and then i looked on the forums, and the Camera.CameraSubject but still couldn’t find anything here is my code:

local plr = game.Players.LocalPlayer

local char = plr.Character or plr.CharacterAdded:Wait()
char:WaitForChild("HumanoidRootPart").Anchored = true


local mouse = plr:GetMouse()

local humanoid = char:FindFirstChildOfClass("Humanoid")


local camera = workspace.CurrentCamera

camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = workspace.MenuComponents.CameraStartPosition.CFrame


local tweenService = game:GetService("TweenService")



local playBtn = script.Parent:WaitForChild("PlayButton"):WaitForChild("TextButton")


local originalCFrame = camera.CFrame
local scaleFactor = 1000


game:GetService("RunService").RenderStepped:Connect(function()
	
	
	local centreOfScreen = Vector2.new(camera.ViewportSize.X / 2, camera.ViewportSize.Y / 2)
	
	local mouseDistanceFromCentre = Vector3.new((-mouse.X - centreOfScreen.X) / scaleFactor, (mouse.Y - centreOfScreen.Y) / scaleFactor, 0)
	
	
	camera.CFrame = originalCFrame * CFrame.new(originalCFrame.LookVector + mouseDistanceFromCentre)
end)


local playButtonClicked = false

playBtn.MouseButton1Click:Connect(function()
	
	if playButtonClicked then return end
	playButtonClicked = true

	print("clicked")
	
	wait(3)
	
	
	char.HumanoidRootPart.Anchored = false
	char.HumanoidRootPart.CFrame = workspace.MenuComponents.SpawnPart.CFrame
	
	camera.CameraType = Enum.CameraType.Custom
	camera.CameraSubject = char:FindFirstChild("Humanoid")
	
end)

	
	
	if playButtonClicked then return end


local function hoverOnButton(btn)
	
	if playButtonClicked then return end
	
	local colourDarken = tweenService:Create(btn, TweenInfo.new(0.1, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut), {BackgroundColor3 = Color3.fromRGB(103, 209, 16)})
	colourDarken:Play()
end

local function hoverOffButton(btn)
	
	if playButtonClicked then return end
	
	local colourNormal = tweenService:Create(btn, TweenInfo.new(0.1, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut), {BackgroundColor3 = Color3.fromRGB(103,209,16)})
	colourNormal:Play()
end


playBtn.MouseEnter:Connect(function()
	
	hoverOnButton(playBtn)
end)

playBtn.MouseLeave:Connect(function()
	
	hoverOffButton(playBtn)
end)

You can try implementing this code into your script
What it does is, when player first clicks button camera moves to part and on second click its turning back to normal

local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")

local Button = script.Parent
local Part = workspace.Part
local Camera = workspace.CurrentCamera

ac = false

Button.MouseButton1Click:Connect(function()
	if ac == false then
		ac = true
		Camera.CameraSubject = Part
		Player.CameraMaxZoomDistance = "1"
	else
		ac = false
		Camera.CameraSubject = Humanoid
		Player.CameraMaxZoomDistance = "128"
	end
end)

I know where you have got the script from, and all I do is just :Destroy() the script. If you need to re-open the menu, get a copy of the script, disable it and put it in replicated storage. Then clone and enable it when it needs to be used.