Switching camera types makes it glitchy

When i am switching my CameraType from scriptable to any other it just makes it glitchy.

Tried everything, cannot seem to find a solution.

https://streamable.com/z38lj1

local plr = game:GetService("Players").LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local cam = workspace.CurrentCamera
local ts = game:GetService("TweenService")
local mouseinS,mouseinP = false,false
local gui = script.Parent
local selected = false
game:GetService("ReplicatedStorage").team.OnClientEvent:Connect(function(thing)
	if thing == "Setup" then
		char.HumanoidRootPart.CFrame = CFrame.new(600, 12, 18)
		cam.CameraType = Enum.CameraType.Custom
		cam.CameraSubject = char:FindFirstChildOfClass("Humanoid")
		plr.PlayerScripts:WaitForChild("teamed").Value = true
	end
end)

spawn(function()
	while not selected do
		task.wait()
		cam.CameraType = Enum.CameraType.Scriptable
		cam.CFrame = workspace["1stCF"].Value
	end
end)

local con1,con2,con3,con4
if plr.PlayerScripts:WaitForChild("KilledBySeeker").Value ~= true and plr.PlayerScripts:WaitForChild("ballin").Value ~= true then
	plr.PlayerScripts:WaitForChild("ballin").Value = true
	ts:Create(gui.seekr,TweenInfo.new(2),{BackgroundTransparency = 0.5}):Play()
	ts:Create(gui.PROP,TweenInfo.new(2),{BackgroundTransparency = 0.5}):Play()
	task.wait(2)
	ts:Create(gui.seekr,TweenInfo.new(1),{TextTransparency = 0}):Play()
	task.wait(.5)
	ts:Create(gui.PROP,TweenInfo.new(1.1),{TextTransparency = 0}):Play()
	task.wait(1)
	gui.seekr.MouseButton1Click:Connect(function()
		game:GetService("ReplicatedStorage").team:FireServer("Seekr")
		selected = true
		con1:Disconnect()con2:Disconnect()con3:Disconnect()con4:Disconnect()
		ts:Create(gui.seekr,TweenInfo.new(1),{Size = UDim2.fromOffset(0,0)}):Play()
		ts:Create(gui.PROP,TweenInfo.new(1),{Size = UDim2.fromOffset(0,0)}):Play()
		task.wait(1)
		ts:Create(gui.Frame,TweenInfo.new(1),{BackgroundTransparency = 1}):Play()
		task.wait(1)
		gui.Enabled = false
	end)
	gui.PROP.MouseButton1Click:Connect(function()
		game:GetService("ReplicatedStorage").team:FireServer("Prop")
		selected = true
		con1:Disconnect()con2:Disconnect()con3:Disconnect()con4:Disconnect()
		ts:Create(gui.seekr,TweenInfo.new(1),{Size = UDim2.fromOffset(0,0)}):Play()
		ts:Create(gui.PROP,TweenInfo.new(1),{Size = UDim2.fromOffset(0,0)}):Play()
		task.wait(1)
		ts:Create(gui.Frame,TweenInfo.new(1),{BackgroundTransparency = 1}):Play()
		task.wait(1)
		gui.Enabled = false
	end)
	con1=gui.seekr.MouseEnter:Connect(function()
		ts:Create(gui.seekr,TweenInfo.new(.4),{Size = UDim2.fromOffset(250,250),BackgroundTransparency = .3,TextSize = 24}):Play()
		mouseinS = true
		task.wait(.6)
		if mouseinS then
			ts:Create(gui.seekr,TweenInfo.new(1),{TextStrokeTransparency = 0.3}):Play()
		end
	end)
	con2=gui.seekr.MouseLeave:Connect(function()
		ts:Create(gui.seekr,TweenInfo.new(1),{TextStrokeTransparency = 1}):Play()
		ts:Create(gui.seekr,TweenInfo.new(.4),{Size = UDim2.fromOffset(200,200),BackgroundTransparency = .5,TextSize = 20}):Play()
		mouseinS = false
	end)
	con3=gui.PROP.MouseEnter:Connect(function()
		ts:Create(gui.PROP,TweenInfo.new(.4),{Size = UDim2.fromOffset(250,250),BackgroundTransparency = .3,TextSize = 24}):Play()
		mouseinP = true
		task.wait(.6)
		if mouseinP then
			ts:Create(gui.PROP,TweenInfo.new(1),{TextStrokeTransparency = 0.3}):Play()
		end
	end)
	con4=gui.PROP.MouseLeave:Connect(function()
		ts:Create(gui.PROP,TweenInfo.new(1),{TextStrokeTransparency = 1}):Play()
		ts:Create(gui.PROP,TweenInfo.new(.4),{Size = UDim2.fromOffset(200,200),BackgroundTransparency = .5,TextSize = 20}):Play()
		mouseinP = false
	end)
end

Found the solution, there was other localscript conflicting with this one.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.