How do I make a tween size upwards instead of downwards?

So for example, I make a frame, which size is {0, 100}, {0, 0} and I tween it so it turns into {0, 100}, {0, 100}. It sizes downwards. So how can I make it size upwards instead of that?

2 Likes

Well, you can’t. This is just how GUI tweens. But what you could do is tween the position too, so that while it’s tweening, it looks like it’s tweening upwards.

1 Like

You should change the anchor point of your frame

1 Like

How could I do that then?

why is there a character minimum bruh

1 Like

Well, first, set your frame to the size you want it to tween to, then move it back upwards, then copy the position and tween the position with the size in two separate tweens

2 Likes

Is the

like from the bottom of the frame, size it down till the Y is {0, 0}?

1 Like

I’m not sure how to explain it

1 Like

Hmm, then I’ll try to experiment and yeah

1 Like

Do you mean this?


@Miserable_Haven

1 Like

Yes that is what I mean but not exactly but yes

1 Like

When I sized it upwards, the position stayed the same.

2 Likes

Like when I scaled it down, the position stayed the same. This is an issue

1 Like

1 Like

Like pulling teeth to get this to go upwards … jezzz

--non-local script in ServerScriptService
local ts =  game:GetService("TweenService")
game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function()
		local playerGui = player:WaitForChild("PlayerGui")
		local frame = playerGui:WaitForChild("ScreenGui").Frame
        -- all this just to get to the frame i want.
		
		task.wait(3) -- so i can see it happen
		
        ----------------- the actual tween code
		local tween = ts:Create(frame, TweenInfo.new(1, Enum.EasingStyle.Linear, 
			Enum.EasingDirection.Out), {Size = UDim2.new(0, 100, 0, 0)})
		tween:Play()
		-----------------
	end)
end)

Edit: Sorry I like this format better … it not only has to work, it needs to look pretty.

frame is set to …
Position {0.5, -50},{0.5, -50} – middle of the screen -half the value of the frame X,Y to center it.
Size {0, 100},{0, 100}

1 Like

Make a frame to put the frames inside you want to resize, then add a uilistlayout and set the alignment to be horizontal and the vertical alignment to bottom. Then when you resize it, it will stay at the bottom.

1 Like

This works fine. The tween knows the size and position … you never need to add that stuff to a tween. You just tell it where it will end up. In this case it’s: Size = UDim2.new(0, 100, 0, 0)

From how you are now to here … kind of thing.

1 Like

I only said that solution become I know it works. It’s also better organization too and doesn’t require you to have to half the offset as the UIListLayout just aligns everything to the bottom… And plus I get correct values too, and it solved OP’s question (title).

2 Likes

That was just to get in the place I wanted had nothing to do with the tween. Could have done that any way. Or just told it in long form … Once there it’s there, tween goes off the position. I also did it the way you are saying.

1 Like

True, but having everything in some sort of layout makes UI more uniform - game’s use this too.

2 Likes

Ya, I almost posted that way, but figured I needed to lose more brain cells and keep pushing.

1 Like