UIListLayout Not Working As Intended

My UIListLayout is not organizing numbers as it should. I currently have 10 buttons in a frame and the order for some reason goes 1, 10, 2, 3… because it’s not putting ten in the right place.

image

How do I fix this? 10 is appearing after 1 and there’s no other way to fix it even with “SortOrder” as “LayoutOrder” because even the layout order will put ten after one when I restart studio.

set the sortOrder of the UiListLayout to I think its called name, basically it sorts based on the name of the thing

Set the SortOrder to Name of the UIListLayout and it will fix your problem.

It’s already on name and I’m having this issue.

This also happened with every other UIListLayour or UIGridLayout in my game.

This is the expected behavior. When sorting alphabetically, 10 sorts before 2, just like BA sorts before C.

If you want to sort it with a number, set the sort order to LayoutOrder then set the LayoutOrder property on the text labels to be in increasing order. This property is numeric, so it handles numbers in the way you would expect.

1 Like

Damn, thanks. I wish I would’ve known this earlier.

You could use SortOrder to name and have the same effect by reversing numbers. Basically you need to make sure that every number is 3 characters long, so 1 becomes 001, 2 becomes 002, 10 becomes 010, and 99 becomes 099. This is the way that roblox sorts stuff, so if you just do that then it would work.