Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there a way to change the order of descendants in an object?

Asked by 5 years ago

Okay, so I was wondering if it is possible to change the position in which a descendant is in an object. So usually this is determined when the object is added into the other object. For example lets say there is a parent instance called A and two instances that go into it called B and C. Now lets say that we put B in first and then C. So in this situation if you were to do :GetChildren() on the object it would return {B,C}. You could visualize this by imagining A being a frame and B and C being buttons. If we also had a UiListLayout in A, B would be on top and C would be on bottom. So hopefully that makes you understand what I mean by order. Now lets say I wanted to add D to the instance A but so it would be between B and C so that it would be between B and C in the list layout. I understand you could take all the instances out of the parent and then put them back in the order you wanted but this seems painfully inefficient. Are there any better ways?

0
just curious, why do you need the explorer to have the children in a specific order? that's chaotic to maintain chomboghai 2044 — 5y
0
Because I am using the UI layouts but im slowly deciding maybe I shouldn't Wafflecow321 457 — 5y

Answer this question