GetChildren||doc136762

September 20, 2022

Format

Window:GetChildren()

Describe

Returns an array containing all immediate child windows.

Return value

Type Describe
table<Window> Array containing all child windows

Code example

The array can be iterated directly using the for loop:

local children = UI.Root:GetChildren()
for i = 1, #children do
    local child = children[i]
    print(child.Name .. " is child number " .. i)
end
local children = UI.Root:GetChildren()
for i, child in ipairs(children) do
    print(child.Name .. " is child number " .. i)
end