Need help with cloned frames in a scrolling frame

Hello Roblox scripting community, recently I’ve been trying to make a clan system where when a player is added to the clan, we see him appear in a list of players.
So I want to make a list of all the players currently present in the clan.

My problem is that I don’t know how to update the position of the frames in the scrolling frame. (For those who didn’t understand, I want frames to update much like Roblox chat messages)

I tried using UIListLayout but it doesn’t work, the frames that are cloned overlap.
As below:

Also I looked on several other topics to find a solution, but nothing works.

Do you have any idea how I can do?

Note: (excuse me for potential mistakes, I am not of English nationality.) :slight_smile:

1 Like

What did you parent UIListLayout to? I use ScrollingFrames in combination with UIListLayout very often in my game, and it works, so either you have a special case or you’re using the element wrong.

My UIListLayout is in my scrolling frame in question.

Capture d’écran 2023-04-10 194129

Mind checking the settings of that UIListLayout, and if you parent the “player card” frames correctly into the ScrollingFrame and not elsewhere? If everything appears fine, send me an rbxm file of the gui without any scripts (if you can and want), I’ll try tinkering around a bit.

So I’ll try that, and if I can’t find it, I’ll send you a copy. But something bothers me, do you think it can be because of the clone I make in my script?


Ideally, this is how UIListLayout should behave with its default settings. Whenever it detects a new child (cloned, moved, created, etc), it will put it at the end, or make space for it somewhere in the middle, depending on how you create it.

1 Like

I see, it’s weird, here are my current settings:

image

That appears to be the default settings. Could you just send me the rbxm file of your gui so I can possibly see what’s up?

Yes.

NOTE: When I do not launch the game by roblox studio and I create new frames, it works very well, however, when I play and my script runs, the frames do not work

If that happens, then it appears to be an issue with your script instead of the UIListLayout. Double-check where you’re cloning the frames, and if you’re modifying their size or position?

Do you want the script with the rbxm?

I do not change their sizes and their proportions, I already have a template defined and then I clone in the scrolling frame

If you want, you can send the script that creates these clones too. I’ll take a look.

I don’t have finish it but ok.

Just keep the part that clones the frames into the ScrollingFrame, you don’t need to include anything else.

1 Like

I don’t know if that’s how you want it but I give it to you as meme.

ScrollingFrameIssue2.rbxl (56.8 KB)

I analyzed the script and I found out what’s wrong.

local slot = temp:Clone()
local ClanSlot = folder:Clone()
-- ...
ClanSlot.Parent = script.Parent.PlayerList

This piece of code creates a folder, clones the folder into the ScrollingFrame, and the player card into that folder. UIListLayout doesn’t know how to and cannot handle folders, so you have an option to clone the player card into the UIListLayout, and then the folder into it like this:

local slot = temp:Clone()
local ClanSlot = folder:Clone()
-- ...
slot.Parent = script.Parent.PlayerList
ClanSlot.Parent = slot

That should make the UIListLayout correctly handle multiple frames, and thus make the script working as intended.

2 Likes

So if I understood correctly, you want to put the player card inside the scrolling frame, then the folder inside this same map?

1 Like

If by “map” you mean the player’s frame, then yes. You can put the folder elsewhere, if you’d like to, but the frame must be parented to the ScrollingFrame.

Ok I see, you answer my question, by doing that I have to change my system, because basically I wanted the clans to be listed in folders then the player cards in this same folder. But
thanks you.