Tween not playing. I need help

Hello! I hope you are having a great day!


I created a camera changer start screen.

local fade = script.Parent.Parent.Fade
local ts = game:GetService("TweenService")
local cam = workspace.CurrentCamera

local goal = {}
goal.BackgroundTransparency = 0
local twi = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0)
local tween = ts:Create(fade, twi, goal)

local goal2 = {}
goal.BackgroundTransparency = 1
local twi2 = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0)
local tween2 = ts:Create(fade, twi2, goal2)

for i, v in pairs(script.Parent:GetChildren()) do
	if v:IsA("GuiButton") then
		v.MouseButton1Click:Connect(function()
			tween:Play()
			wait(0.5)
			cam.CameraType = Enum.CameraType.Scriptable
			cam.CFrame = workspace.Cameras[v.Name].CFrame
			script.Parent.Parent.Spawn:SetAttribute("CurrentSelectedPlace", v.Name)
			tween2:Play()
		end)
	end
end

However, tween2 is not playing.

Attribute is setting, but tween2 is not…

If you can help, please let me know, Thanks, WE!

goal2.BackgroundTransparency not goal.BackgroundTransparency.

1 Like