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?
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.
You should change the anchor point of your frame
How could I do that then?
why is there a character minimum bruh
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
Is the
like from the bottom of the frame, size it down till the Y is {0, 0}?
I’m not sure how to explain it
Hmm, then I’ll try to experiment and yeah
Yes that is what I mean but not exactly but yes
When I sized it upwards, the position stayed the same.
Like when I scaled it down, the position stayed the same. This is an issue
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}
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.
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.
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).
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.
True, but having everything in some sort of layout makes UI more uniform - game’s use this too.
Ya, I almost posted that way, but figured I needed to lose more brain cells and keep pushing.