WaitForChild
Yields until the child exists (or times out).
Syntax
:WaitForChild(name: string, timeout?: any) -> Instance
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | The name used for the lookup or new object. |
timeout? | any | The timeout value used by the call. |
Returns
| Type | Description |
|---|---|
Instance | Instance? |
Description
WaitForChild is part of the Instances library. Instances are live proxies backed by game memory. Property reads and method calls go through Roblox's own objects.
The calling thread yields as needed and resumes on the module scheduler when the operation completes.
Example
local target = workspace:WaitForChild("Map", 5)
print(target)
Notes
- Instance proxies are backed by live game memory.