Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

GUI Tweening in wrong direction, no errors in script?

Asked by 4 years ago

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

0
Add a minus symbol ( - ) try it now. Serpawh -4 — 4y
0
didn't quite work. Gomenasa1 32 — 4y
0
If you put Vector2 in its stead, perhaps it could work. As you need it to tween along the Y axis. Go ahead. Serpawh -4 — 4y
0
Didn't work either... ;-; Gomenasa1 32 — 4y
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" alphawolvess 1784 — 4y

2 answers

Log in to vote
1
Answered by
sleazel 1287 Moderation Voter
4 years ago

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)
0
Close, the GUI is positioned based on it's AnchorPoint, which I believe is default on the top left corner. alphawolvess 1784 — 4y
0
Ty! This helped a ton :)) Gomenasa1 32 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

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

0
Do not talk negatively about other members. It makes you look worse than the person you are trying to degrade. alphawolvess 1784 — 4y
0
i guess Gameplayer365247v2 1055 — 4y

Answer this question