When I click the playbutton the tween works but then when I click the back button it does not tween smoothly to its original position and when I click the playbutton again, it doesn't tween like it did the first time. I am so confused.
local backgroundframe = script.Parent
local campaignbackground = backgroundframe.CampaignBackground
local back = campaignbackground.Back
playbutton.MouseButton1Down:connect(function()
campaignbackground.Visible = true
campaignbackground:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quad", 1, true)
end)
back.MouseButton1Down:connect(function()
campaignbackground:TweenPosition(UDim2.new(-0.25, 0, -200, 0), "Out", "Quad", 1, true)
campaignbackground.Visible = false
end)

1 comment
For your back button, you need to wait for the tween to complete before you make it invisible.