Is there a way to limit the ScrollingFrame's scroll distance?

I am trying to set up a ScrollingFrame, but you can scroll even when there are no items in the ScrollingFrame itself, which means you can scroll literally everything out of view.

I know there’s a way to limit how far you can scroll, I just don’t know how to do it. I thought it might be something like AutomaticCanvasSize = true, but that doesn’t actually seem to effect anything. Maybe it’s a combination of AutomaticCanvasSize and CanvasSize? I don’t really know.

I think it’s worth mentioning that the ScrollingFrame will be populated based on a dynamic list of things fed to it, so there’s no one-size-fits-all. So an automatic method would be great.

2 Likes

To use automatic canvas size, you need to put:

local scrollingframe = game.Players.LocalPlayer.ScreenGui.ScrollingFrame -- Change this
scrollingframe.CanvasSize = UDim2.new(0,0,0,0)
scrollingframe.AutomaticCanvasSize = Enum.AutomaticSize.Y -- You can use XY and X
1 Like

That still results in an issue. Now instead of having a scrollbar, items just pour off the edge of the UI entirely.

Scratch that. I had set AutomaticSize to Y as well, and that was causing the issue.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.