Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

GUI Tweening in wrong direction, no errors in script?

So I'm currently working on the UI for my game and I am something tween, but as it tweens it stretches in the exact opposite direction that I want it to... I think its a gui error, not a script error but here is the script anyways:

script.Parent.RunningCool:TweenSize(
		UDim2.new(0.026, 0,0.049, 0),
		Enum.EasingDirection.Out,
		Enum.EasingStyle.Quad,
		20)

and a gif of what's happening: https://gyazo.com/b011cb1ebf9d45377c280e8b0420854d

5 comments

0

Add a minus symbol ( - ) try it now.

0

didn't quite work.

0

If you put Vector2 in its stead, perhaps it could work. As you need it to tween along the Y axis. Go ahead.

0

Didn't work either... ;-;

0

I find it best practice to edit the property you are trying to tween to see where the end point is, Then move it back to the original position so you know "Point A and B"

2 answers

✓ Accepted answer

Unlike parts in the workspace, GUI elements are positioned in relation to the top left corner. So they will always stretch right and/or down. To stretch them up and/or left, you'll need to tween position as well. I can not fill the numbers for you, as I would have to know initial size and position. But you can do it yourself, all you need to find is the new left top corner position.

script.Parent.RunningCool:TweenSizeAndPosition(
        UDim2.new(0.026, 0,0.049, 0),
        UDim2.new(0,0,0,0), --replace zeroes with new top left corner position
        Enum.EasingDirection.Out,
        Enum.EasingStyle.Quad,
        20)

2 comments

0

Close, the GUI is positioned based on it's AnchorPoint, which I believe is default on the top left corner.

0

Ty! This helped a ton :))

dont listen to this noob, to move a gui you do need UDim so you got that part but the thing you are doing wrong if it still moves in the wrong direction is you need other numbers, make sure the position you want the gui on is that position you got in the script

2 comments

0

Do not talk negatively about other members. It makes you look worse than the person you are trying to degrade.

0

i guess

This discussion is preserved as it was. New answers, comments, and votes are closed.