The second time round I click the “MENU” button it doesn’t have the nice fade effect. I want the fade effect to always work every time I click the “MENU” button.
I think the issue may be to do with the values but I can’t quite understand my thoughts.
[Uploading: 2022-04-23 15-03-00.mp4…](Video of Problem)
local back_button = gui.Store.back_button
back_button.MouseButton1Down:Connect(function()
back_button.MouseEnter:Connect(function()
back_button:TweenSize(UDim2.new(0.205, 0, 0.097, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.2, true)
end)
back_button.MouseLeave:Connect(function()
back_button:TweenSize(UDim2.new(0.181, 0, 0.085, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.2, true)
end)
back_button.MouseButton1Down:Connect(function()
local tween1 = game.TweenService:Create(gui.Fade, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out),{["BackgroundTransparency"] = 0})
tween1:Play()
tween1.Completed:wait()
gui.Buttons.Visible = true
gui.Store.Visible = false
tween1 = game.TweenService:Create(gui.Fade, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {["BackgroundTransparency"] = 1})
tween1:Play()
tween1.Completed:wait()
end)
end)