GetChildren() VS GetDescendants()

As said in the title I want to know what the difference is between these two things.
If there is a post on this already I could not find it

read devforums or look for your problem before making a topic

GetChildren gets the children of the provided object, GetDescendants gets every object under the provided object

Visual Example:

If I were to use :GetChildren() on workspace.Folder
image
It returns those folders.

Now, if I were to use :GetDescendants() on workspace.Folder
image
It returns those folders.

1 Like

Suppose the heirarchy is set up like this:

  • Model
    • Folder
    • Part
      • Attachment

Doing model:GetChildren() will return {Folder, Part} but not Attachment. Basically only the direct children of Model (everything with the empty bullet point)

Doing model:GetDescendants() will return {Folder, Part, Attachment} but not Attachment. Basically everything under the model.

Note: :GetDescendants() will get absolutely everything underneath workspace.Folder.

Right. . . because I didnt already do this . . .

i found it by going to google and typing in your topics title, first result, sorry man

1 Like