Hey all! I'm a bit stumbled on how to increase the CanvasSize of a ScrollingFrame, as more objects are added to it. The trick for me, is that the TextButtons within it, use Y Offset, instead of Scale (For both position and size). My original plan was to first set out a template, of how many it would take, until 1 can't be fully seen. Then, add up all of their sizes, then put that as the CanvasSize. However, that didn't work, since the Scrollbar has not yet shown. Any ideas? Each TextButton size is 30 Y offset, and 31 Y offset apart from each other. Any tips?
✓ ANSWER ACCEPTED
How to increase the CanvasSize as more objects are added to a ScrollingFrame?
2 answers
✓ Accepted answer
Take the last TextButtons Position.Y.Offset and add it's Size.Y.Offset, then set this as the CanvasSize.
So more guis will be added to it in-game? In that case, you could just use the ChildAdded event. When a new gui is added, increase the size accordingly.
script.Parent.ChildAdded:connect(function(child)
--Increase CanvasSize based on size of child
end)
I've never actually worked with scrolling frames, but this makes sense to me.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
That does work, however it would keep scrolling until the last button is at the top. How would I make it, so it stops when the last button fully shows at the bottom?