GetChildByName
Returns a child by name. Null if a child is not found.
note
- You can also use GetChildByName to find an Item by path!
- For example
namewould return the child first namedname name/item1would find a child namedname, then find a child in there nameditem1- See Transform.Find for more information
- For example
Parameters
| Parameter Name | Parameter Type | Parameter Description |
|---|---|---|
| name | string | The name or path to the Item. |
The following example gets a child named deathItem under a child named tool.
JavaScript
// Assume an Item is defined as item
let death = item.GetChildByName("tool/deathItem")
Lua
-- Assume an Item is defined as item
local death = item.GetChildByName("tool/deathItem")