TweenSize exceeds the value I want it to be?
So, I made a :TweenPosition() to occur whenever a person hovers their mouse to a textbutton, since I am doing this for multiple buttons I decided to use a for loop to loop through all of the buttons and give them that function; the consequences of this, is I wouldn't be independent to give the TweenPosition specific UDims for each button. So I decided to go with:
01 | button.MouseEnter:connect( function () |
02 | for index, object in pairs (screen:findFirstChild( "Objects" ):GetChildren()) |
05 | button [ "button_label" ] :TweenSize( |
06 | button [ "button_label" ] .Size + UDim 2. new( 0 , 15 , 0 , 0 ), |
15 | button.MouseLeave:connect( function () |
16 | button [ "button_label" ] :TweenSize( |
17 | button [ "button_label" ] .Size - UDim 2. new( 0 , 15 , 0 , 0 ), |
When I do this, the tween returns me the Button's size as a random size chosen from 0 to 15, therefore when I continue with -UDim2.new(0, 15, 0, 0)
It subtracts an unequal number and therefore exceeds below its original size. Can anyone give me an idea of what I could do here to match the given size and the number I'll subtract so it can return to its original size when I remove my mouse from it. **Thank you! I have more to improve! **