Script that changes 3d view to 2d and vice versa doesnt work

ay
so this script i made:

local camTHREEd = game.Workspace.Cameras.THREEDCameraArea
local camTWOd = game.Workspace.Cameras.TWODCameraArea
local player = game.Players.LocalPlayer
local camera = game.Workspace.CurrentCamera

camTHREEd.Touched:connect(function()
	camTHREEd.CanTouch = false
	camTWOd.CanTouch = true
	camera.CameraType = Enum.CameraType.Custom
	camera.CameraSubject = player.Character.Humanoid
	if player.Character.Torso.CameraPart then
		player.Character.Torso.CameraPart.Parent = game.ReplicatedStorage
	else
		
	end
end)
camTWOd.Touched:connect(function()
	camTWOd.CanTouch = false
	camTHREEd.CanTouch = true
	camera.CameraType = Enum.CameraType.Scriptable
	camera.CameraSubject = player.Character.Head
	local part = game.ReplicatedStorage.CameraPart
	part.Parent = player.Character.Torso
	game:GetService("RunService").Stepped:Connect(function()
		part.Position = player.Character.Torso.Position + Vector3.new(-10, 2, 0)
		camera.CFrame = part.CFrame
	end)
	end)


it should change camera view from 3d to 2d and vice versa
but when it changes from 2d view to 3d the camera is still locked (i mean, you can wobble it around, not like in 2d view, but its still glued to one position)

heelp plees