FANDOM


This method returns a table of all the direct children of an object.


GetChildren()
Arguments None
Found in Any object

Examples right from the staff

local children = game.Workspace:GetChildren()
for c = 1, #children do
    print(children[c].Name)
end
local children = game.Workspace:GetChildren()
for i, j in ipairs(children) do
    print("index: ")  --j is the object, i is the index of the table it is at
    print(i)
    print("Object: ")
    print(j)
end

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.