GetDescendants() return ordering

Based on what was previously documented (Add Instance:GetDescendants() - #31 by Tiffblocks) (Previously documented GetDescendants order no longer documented), the order of the return from GetDescendants() is supposed to be “Parents before children.” However, this is no longer mentioned in the current documentation as of 2025 at all. The second post I linked specifies a similar issue which seems to have been resolved but now is un-resolved. Because the current documentation:

This object method returns an array that contains all of the descendants of that object. Unlike Instance:GetChildren(), which only returns the immediate children of an object, this method finds every child of the object, every child of those children, and so on.

No mention of the return ordering. Not the previously documented “Parents before children,” and not even “No ordering guaranteed.” To preserve backward compatibility, I feel the previously-documented “Parents come before children” should be preserved and documented, but even if you no longer want to make promises, explicitly state that the sort order is not specified.

Page URL: https://create.roblox.com/docs/reference/engine/classes/Instance#GetDescendants

Hi @asadefa ,
Thanks for the feedback. Unless it’s stated somewhere that a specific ordering is guaranteed, please treat all received arrays/objects as unsorted. For this, I’ll schedule adding a note which clarifies that the order is not guaranteed.

If you haven’t spotted it yet, also consider using the https://create.roblox.com/docs/en-us/reference/engine/classes/Instance#QueryDescendants method to filter descendants by selectors and combinators.

Take care,
IgnisRBX

1 Like

Hi again @asadefa ,
The update is live. :slight_smile:
https://create.roblox.com/docs/en-us/reference/engine/classes/Instance#GetDescendants