Control:GetChildren
Lists a control's direct children.
Syntax
Signature
Control:GetChildren() -> {DrawingControl}Aliases
This function has no aliases.
Parameters
This function takes no parameters.
Returns
| Type | Description |
|---|---|
{DrawingControl} | Direct live children. |
Notes
Descendants below those children are not included.
Example
Luau
local Frame = Drawing.create("Frame", {Size = Vector2.new(240, 120)})
Drawing.create("TextLabel", {Parent = Frame, Text = "First"})
Drawing.create("TextLabel", {
Parent = Frame,
Position = Vector2.new(0, 35),
Text = "Second",
})
for _, Child in Frame:GetChildren() do
print(Child.Text)
end
task.delay(5, function() Frame:Destroy() end)