camera.CameraSubject problem

so I’m working on an intro camera scene, and when you join the game, the focus doesn’t move to the part that it’s supposed to. also, once you click play, the camera doesn’t move back to the character.

https://gyazo.com/23c3a02b73d6047bd383a3bdad294fcd

here’s the script. it should tween the gui, delete it, delete the camera part and the blur, then move the players camera back to the character


camera.CameraSubject = camPart
blur.Parent = game.Lighting
camPart.Parent = workspace
camera.CameraSubject = camPart

script.Parent.TextButton.MouseButton1Click:Connect(function()
	camera.CameraSubject = game.Players.LocalPlayer.Character
	script.Parent.TextButton:TweenPosition(UDim2.new(0.5,0,1.2,0),"Out","Elastic",2)
	script.Parent.Title:TweenPosition(UDim2.new(0.5,0,-0.3,0),"Out","Elastic",2)
	repeat
		blur.Size -= 3
		wait(0.05)
	until blur.Size <= 0
		
	blur:Destroy()
	script.Parent.Enabled = false
	camPart:Destroy()
	
	camera.CameraSubject = game.Players.LocalPlayer.Character
	script.LocalScript.Disabled = true
	script.Disabled = true
end)

Instead of

camera.CameraSubject = game.Players.LocalPlayer.Character

Try

camera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid

the same thing happened unfortunately.
still no errors.

I presume that the camera Variable is set to workspace.CurrentCamera?

Try reading about how to use the CameraSubject to reset it to the default position here

https://developer.roblox.com/en-us/api-reference/property/Camera/CameraSubject

The example they provided to reset the camera back was this

local Players = game:GetService("Players")
 
local localPlayer = Players.LocalPlayer
 
local function resetCameraSubject()
	if workspace.CurrentCamera and localPlayer.Character then
		local humanoid = localPlayer.Character:FindFirstChildOfClass("Humanoid")
		if humanoid then
			workspace.CurrentCamera.CameraSubject = humanoid
		end
	end
end

Maybe you could try to rework it to work with your code?