Reset Tween Size after animation finished

I am trying to reset a tween after the animation has finished. I’ve not used tweens before.

This is the code I have done so far:

local OriginalSize = script.Parent.Size

repeat wait() until script.Parent.Parent.Visible == true
script.Parent:TweenSize(UDim2.new(1,0,1,0), "InOut", "Sine", 13)
wait(13)
script.Parent.Size = OriginalSize
script.Parent.Visible = true

Any help will be appreciated!

I will try that now!

charcharchar

The code works for me; might be a problem on your side but try increasing the wait time (try 0.5 seconds) because if I had to guess the tween was just barely not done and it changed the size right before it had finished.

Didn’t seem to work, the Frame shows however the size is the same as before.

Alrighty, will do!

charcharchar

Just did some changes for you to improve with performance.

script.Parent.Parent:GetPropertyChangedSignal("Visible"):Connect(function()
if  script.Parent.Parent.Visible == true then
script.Parent:TweenSize(UDim2.new(1,0,1,0), "InOut", "Sine", 13)
task.wait(13)
script.Parent.Size = OriginalSize
script.Parent.Visible = true
end
end

It is now fixed, a UICorner was interfering somehow.

This helped a lot so thank you!