Tween does not work as expected

While working on some of my UIs I encountered this “bug” where the tween would not play. There are no errors in the output and it worked perfectly before.
This is part of the code that would handle the tweening. I am not sure what is causing this as other tweens affecting this asset work. Any help is appreciated.
If more information is required, please let me know.

Copy:TweenSize(UDim2.new(1,0,0,50),"InOut","Linear",0.5,true,function(done)
							if done == Enum.TweenStatus.Completed and Copy then
								Run.MouseButton1Click:Connect(function()
									RippleFX.new(CComp,Mouse.X,Mouse.Y)
									if value["on"] == true then
										RemoteEvent:FireServer(Copy.Name,FullUsername(UserBox.Text))
									else
										return 
									end
								end)							
							end
						end)

This probably isn’t the issue but replace
if done == Enum.TweenStatus.Completed and Copy then
with
if done and Copy then

If I understand correctly, the tween isn’t playing and the it’s not the function within the tween that isn’t working. In that case, it would seem that the script is not reaching the actual tween code (so long as there are no errors). Look for somewhere in your code that might get the script caught up. Things like while loops, infinite waitforchilds, returns, breaks, continues etc…

You can check by putting a print statement right before (or after) the tween to see if the print runs

1 Like

Thanks for your reply. While debugging, I have found that the Copy size wasn’t set correctly. The tween was working, it just wouldn’t show.