Why isn't this working?

I have a Menu Menu that has a custom camera location. I transferred this from an older game of mine. But Its is not simply working. When the play button is pressed everything works except the camera remains in the set position, not focused on the player. IDK What happened between the two games? I just changed some lines of code, but nothing related to the camera.

The script in the New Game (Camera not returning to player)

local plr = game.Players.LocalPlayer

local char = plr.Character or plr.CharacterAdded:Wait()

local mouse = plr:GetMouse()

local camera = workspace.CurrentCamera

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


local tweenService = game:GetService("TweenService")


local mainMenuGui = script.Parent


local mainMenuBG = mainMenuGui:WaitForChild("MainMenuBackground")

local playBtn = mainMenuBG:WaitForChild("PlayButton")
local creditsBtn = mainMenuBG:WaitForChild("CreditsButton")

local creditsBG = mainMenuBG:WaitForChild("CreditsBackground")


local players = game:GetService('Players')
local starterGui = game:GetService('StarterGui')
local userInputService = game:GetService('UserInputService')
local runService = game:GetService('RunService')

local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:wait()
local humanoid = character:WaitForChild('Humanoid')
local coreCall do
	local MAX_RETRIES = 10

	function coreCall(method, ...)
		local result = {}
		for retries = 1, MAX_RETRIES do
			result = {pcall(starterGui[method], starterGui, ...)}
			if result[1] then
				break
			end
			wait(1)
		end
		return unpack(result)
	end
end

local GUIsToDisable = {}
local noMoveConnection
noMoveConnection = runService.Heartbeat:Connect(function()
	if humanoid then
		humanoid.WalkSpeed = 0
		humanoid.JumpPower = 0
		humanoid:UnequipTools()
	end
	for _, gui in pairs(GUIsToDisable) do
		if player.PlayerGui:FindFirstChild(gui) then player.PlayerGui[gui].Enabled = false end
	end
end)


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
	
	
	creditsBG:TweenPosition(UDim2.new(-0.5, 0, 0.5, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 1, true)
	
	mainMenuBG:TweenPosition(UDim2.new(-1, 0, 0, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 3, true)
	
	
	wait(3)
	
	
	char.HumanoidRootPart.CFrame = workspace.MenuComponents.SpawnPart.CFrame
	camera.CameraType = Enum.CameraType.Custom
	script.Parent.Enabled = false
	script.Parent.MainMenuBackground.Warper.Visible = false
	game.Workspace.Script:Destroy()
	game.Lighting.Music:Destroy()
	coreCall('SetCoreGuiEnabled', 'All', true)
	coreCall('SetCore', 'ResetButtonCallback', true)
	userInputService.ModalEnabled = false
	if humanoid then
		humanoid.WalkSpeed = 16
		humanoid.JumpPower = 50
	end
	for _, gui in pairs(GUIsToDisable) do
		if player.PlayerGui:FindFirstChild(gui) then player.PlayerGui[gui].Enabled = true end
	end
	noMoveConnection:Disconnect()
	noMoveConnection = nil
	camera.CameraType = Enum.CameraType.Custom
end)


local creditsOpen = false

creditsBtn.MouseButton1Click:Connect(function()
	
	
	if playButtonClicked then return end
	
	
	if creditsOpen then
		creditsBG:TweenPosition(UDim2.new(-0.5, 0, 0.5, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 1, true)
		
	else
		creditsBG:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 1, true)
	end
	
	creditsOpen = not creditsOpen
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), {ImageColor3 = Color3.fromRGB(221, 221, 221)})
	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), {ImageColor3 = Color3.fromRGB(255, 255, 255)})
	colourNormal:Play()
end


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

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

The script in the old Game (Camera Returns to player)

local plr = game.Players.LocalPlayer

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


local mouse = plr:GetMouse()
local menu = script.Parent.Parent.HealthBarGui
local menu2 = script.Parent.Parent.StaminaBarGui
local menu3 = script.Parent.Parent.LevelBar

local camera = workspace.CurrentCamera

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


local tweenService = game:GetService("TweenService")


local mainMenuGui = script.Parent


local mainMenuBG = mainMenuGui:WaitForChild("MainMenuBackground")

local playBtn = mainMenuBG:WaitForChild("PlayButton")
local creditsBtn = mainMenuBG:WaitForChild("CreditsButton")

local creditsBG = mainMenuBG:WaitForChild("CreditsBackground")


local loadingScreenBG = mainMenuGui:WaitForChild("LoadingScreenBackground")

local logo = loadingScreenBG:WaitForChild("Logo")

local loadingBarBG = loadingScreenBG:WaitForChild("LoadingBarBG")
local clippingFrame = loadingBarBG:WaitForChild("ClippingFrame")
local loadingBar = clippingFrame:WaitForChild("LoadingBar")


clippingFrame.Size = UDim2.new(0, 0, 1, 0)

clippingFrame:TweenSize(UDim2.new(1, 0, 1, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 5)


clippingFrame:GetPropertyChangedSignal("Size"):Connect(function()	
	
	loadingBar.Size = UDim2.new(1/clippingFrame.Size.X.Scale, 0, 1, 0)
end)


repeat wait() until clippingFrame.Size == UDim2.new(1, 0, 1, 0)



local loadingScreenFade = tweenService:Create(loadingScreenBG, TweenInfo.new(3, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut), {BackgroundTransparency = 1})
loadingScreenFade:Play()


logo:TweenPosition(UDim2.new(0.5, 0, -0.5, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 2)
loadingBarBG:TweenPosition(UDim2.new(0.5, 0, 1.5, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 2)


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
	
	
	creditsBG:TweenPosition(UDim2.new(-0.5, 0, 0.5, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 1, true)
	
	mainMenuBG:TweenPosition(UDim2.new(-1, 0, 0, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 3, true)
	
	
	wait(3)
	
	
	char.HumanoidRootPart.Anchored = false
	char.HumanoidRootPart.CFrame = workspace.MenuComponents.SpawnPart.CFrame
	
	camera.CameraType = Enum.CameraType.Custom
	menu.Enabled = true
	menu2.Enabled = true
	menu3.Enabled = true
	mainMenuGui:Destroy()
end)


local creditsOpen = false

creditsBtn.MouseButton1Click:Connect(function()
	
	
	if playButtonClicked then return end
	
	
	if creditsOpen then
		creditsBG:TweenPosition(UDim2.new(-0.5, 0, 0.5, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 1, true)
		
	else
		creditsBG:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 1, true)
	end
	
	creditsOpen = not creditsOpen
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), {ImageColor3 = Color3.fromRGB(221, 221, 221)})
	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), {ImageColor3 = Color3.fromRGB(255, 255, 255)})
	colourNormal:Play()
end


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

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

Have you checked the output for errors?

I checked it there were no errors

Here’s a little clip of what’s happening

This signal RenderStepped returns an RBXScriptConnection (or simply Connection) when :Connect()'ing that you could disconnect. Perhaps when you want the user’s Camera to return, maybe disconnect that too?

local plr = game.Players.LocalPlayer


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

local mouse = plr:GetMouse()

local camera = workspace.CurrentCamera

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


local tweenService = game:GetService("TweenService")


local mainMenuGui = script.Parent


local mainMenuBG = mainMenuGui:WaitForChild("MainMenuBackground")

local playBtn = mainMenuBG:WaitForChild("PlayButton")
local creditsBtn = mainMenuBG:WaitForChild("CreditsButton")

local creditsBG = mainMenuBG:WaitForChild("CreditsBackground")


local loadingScreenBG = mainMenuGui:WaitForChild("LoadingScreenBackground")

local logo = loadingScreenBG:WaitForChild("Logo")

local loadingBarBG = loadingScreenBG:WaitForChild("LoadingBarBG")
local clippingFrame = loadingBarBG:WaitForChild("ClippingFrame")
local loadingBar = clippingFrame:WaitForChild("LoadingBar")

local starterGui = game:GetService('StarterGui')
local coreCall do
	local MAX_RETRIES = 10

	function coreCall(method, ...)
		local result = {}
		for retries = 1, MAX_RETRIES do
			result = {pcall(starterGui[method], starterGui, ...)}
			if result[1] then
				break
			end
			wait(1)
		end
		return unpack(result)
	end
end

clippingFrame.Size = UDim2.new(0, 0, 1, 0)

clippingFrame:TweenSize(UDim2.new(1, 0, 1, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 5)


clippingFrame:GetPropertyChangedSignal("Size"):Connect(function()	
	
	loadingBar.Size = UDim2.new(1/clippingFrame.Size.X.Scale, 0, 1, 0)
end)


repeat wait() until clippingFrame.Size == UDim2.new(1, 0, 1, 0)



local loadingScreenFade = tweenService:Create(loadingScreenBG, TweenInfo.new(3, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut), {BackgroundTransparency = 1})
loadingScreenFade:Play()


logo:TweenPosition(UDim2.new(0.5, 0, -0.5, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 2)
loadingBarBG:TweenPosition(UDim2.new(0.5, 0, 1.5, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 2)


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
	
	
	creditsBG:TweenPosition(UDim2.new(-0.5, 0, 0.5, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 1, true)
	
	mainMenuBG:TweenPosition(UDim2.new(-1, 0, 0, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 3, true)
	
	
	wait(3)
	
	
	char.HumanoidRootPart.Anchored = false
	char.HumanoidRootPart.CFrame = workspace.MenuComponents.SpawnPart.CFrame
	
	camera.CameraType = Enum.CameraType.Custom
	humanoid.WalkSpeed = 16
	humanoid.JumpPower = 50
	game.Workspace.Script:Destroy()
	game.Lighting.Music:Destroy()
	coreCall('SetCoreGuiEnabled', 'All', true)
	coreCall('SetCore', 'ResetButtonCallback', true)
	mainMenuGui:Destroy()
end)


local creditsOpen = false

creditsBtn.MouseButton1Click:Connect(function()
	
	
	if playButtonClicked then return end
	
	
	if creditsOpen then
		creditsBG:TweenPosition(UDim2.new(-0.5, 0, 0.5, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 1, true)
		
	else
		creditsBG:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 1, true)
	end
	
	creditsOpen = not creditsOpen
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), {ImageColor3 = Color3.fromRGB(221, 221, 221)})
	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), {ImageColor3 = Color3.fromRGB(255, 255, 255)})
	colourNormal:Play()
end


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

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