Hi all, I've been trying this for far too long now.
Basically, I'm trying to make a script which sizes the CanvasSize of the ScrollingFrame to meet the need of how many TextButtons I have within that ScrollingFrame (I'm doing this because I intend to use it as a module so I don't have to reposition and move every single part).
I'm trying to dictate the size of all of these objects using only scale, not offset. I'm only doing this in the Y direction.
So... If I have 1 TextButton I want the ScrollingFrame to be 1*TextButton tall and the TextButton position to = 0. Makes sense right? .. This works fine until the TextButton position >=1 because the TextButtons are being placed outside of the ScrollingFrame (the position seems to be working off the position of ScrollingFrame.Size not ScrollingFrame.CanvasSive).
How can I make it so no matter how many TextButtons I put inside the ScrollingFrame they will asll display and be positioned right next to each other (vertically).
This is what I have at the moment (after many, many iterations lol):
local menu = script.Parent
local tiersFrame = menu.tiers
local tiers = tiersFrame:GetChildren()
local sz = 0.2
tiersFrame.CanvasSize = UDim2.fromScale(1, ???)
for i,v in ipairs(tiers) do wait()
v.Size = UDim2.fromScale(0.8, sz)
v.Position = UDim2.fromScale(0.2, ????)
end
Please can someone help me with this, I've really tried quite a lot to make it work but idk how to :/
Thank you, AlexTheCreator

1 comment
Tried using a UIGridLayout?