How do I create a ScrollingFrame that changes its contents?

Hello there ! I am trying to make a ScrollingFrame that changes it’s contents whenever a button is clicked. So I put it’s contents in a folder but then realized:

I can’t disable folders or ScrollingFrames
I can’t store the contents in ReplicatedStorage either

Is there a simple way to do this ? I was thinking about storing the contents in PlayerGui, but then I realized that there were too many to disable or enable, and it will cause lag. I only have ImageButtons inside the ScrollingFrame, nothing else.

If anybody knows how to do this, It would be greatly appreaciated !

1 Like

Perhaps you can elaborate, I don’t really understand what you’ve tried or what the issue is.

I can’t disable folders or ScrollingFrames

Not sure what you mean by that, folders are not GUI elements, what is there to disable?
ScrollingFrames can be disabled, both in interactivity and visibility.

I was thinking about storing the contents in PlayerGui, but then I realized that there were too many to disable or enable, and it will cause lag

Did you try? It really shouldn’t lag…

1 Like

What property can be changed to make them not visible and not interactable ?

Hey, mind elaborating on what your desired outcome is?

From what I gathered, you are trying to have multiple different ScrollingFrames each represent a different state, and hide/display them as needed. Is this correct? If so, what is your use-case specifically?

Visible

Yes that’s what I want, my use case is a list with multiple categories, you can click on a button to change the items in the list, that’s basically what I need.

You don’t have to have multiple pre-set ScrollingFrames, from the sounds of it you can simply use one and swap out the contents as needed. I’ve created an example implementation here: demo.rbxm (5.7 KB)

If your implementation does not allow this, you could alternatively (although I recommend against it) toggle the ScrollingFrame.Visible property to hide one frame and display another.