Is there anyway to scroll a scrolling frame via scripts?

As the title, I want to scroll a scrolling frame using scripts so players won’t have to scroll the frame every time.

But I cannot seem to find any information regarding the subject.

Is there a built-in non-hacky way of doing so? I am aware of hacky methods but they seem to be computationally expensive.

2 Likes

Hey there @Feedekaiser!

I decided to give you a script solution because I was interested in this myself, and it actually took a bit to figure out.The scrolling frame property that determines how much the scroll bar can go is the second Y value of CanvasSize if you want to set it in the properties window, otherwise, it would be the CanvasSize Offset. This just loops through it and when it gets to the end, it goes back up to the beginning.

local max = script.Parent.CanvasSize.Y.Offset
for i=1,max do
    script.Parent.CanvasPosition = Vector2.new(0,i)
    if i==max then
        i=1
    end
    wait()
end

It scrolls the frame to 1 point to another.

6 Likes