Help how to make autoscroll in ScrollingFrame so that it scrolls to the size of the gui that is in the ScrollingFrame
✓ ANSWER ACCEPTED
How to make ScrollingFrame autoscroll?
1 answer
✓ Accepted answer
If you have something like a UIListLayout or UIGridLayout, you can use the following code.
local layout = -- Reference your UI layout object
local scrollingFrame = -- Reference your scrolling frame
local function setSize()
local contentSize = layout.AbsoluteContentSize
scrollingFrame.CanvasSize = Vector2.new(contentSize.X, contentSize.Y)
end
setSize() -- Update the size as soon as the game starts so if there is already something in it, it will be displayed correctly.
layout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
setSize()
end)
This code uses the GetPropertyChangedSignal event to detect when the total size of the content being manipulated by the UI layout object is changed. This means that if something new gets added to the scrolling frame, it will automatically update.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
I don’t have this, I need it to scroll one object that is stretched
You may be able to use AbsoluteContentSize on the scrolling frame too.