How would be the easiest way to go about sorting a UiGridLayout by age

what would be the easiest or best way to make Ui sort by recently added with a UiGridLayout?

(sorry that I suck at explaining stuff <3)

You can order them by name.

Numbers will appear in order; however, if you name something like: “button2” and “button13”, “button13” will appear before “button2” because it reads left to right and because 1 is lower than 2, it appears first. You would have to find a way around this, though. I can’t think if any other way to do order elements properly.

I think a solution to this might be having a specific naming template like: element1, element21 (the lower the number the older the UI element) and then sorting it by script by checking the numbers in the name every time a new element might appear (using some kind of sorting algorithm).

I would set the LayoutOrder to the age or -age for descending

thank you I was actually saving the age of the ui for other purposes, forgot I could use that with layout order. appreciate it

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