FindFirstChildFunction of Instance
Ref<Instance> FindFirstChild (
bool recursive = false
- Type: bool
- Defaults to: false
Description: Returns the first child found with the given name, or nil if no such child exists. If the optional recursive argument is true, recursively descends the hierarchy while searching rather than only searching the immediate object.
Here's a pure Lua implementation of FindFirstChild to demonstrate how it works:
The below would look in Workspace for an object name "Brick". If found, it will change the name of the object to "Foo".