Ordering a UI list

im creating a kill feed back list which shows who killed who. now i want to order this list from new to old.
how can i do this in c#?
also im using a Vertical Layout Group.

thanks!

When you add a child to an object with a layout group, the order of the children determines where it is displayed.

So, once you create a new object and add it as a parent, use the setAsFirstSibling call to move it to the top of the children hierarchy. Unity - Scripting API: Transform.SetAsFirstSibling.

Now, if you are adding it to an actual list (Like List) then you can insert the object in the list at the start.

1 Like