LensStudio:HierarchyUtils.js.findOrCreateChildWithName
FunctionFinds or creates a child scene object with the specified name under the given root object.
findOrCreateChildWithName(
rootObject,name,scene):SceneObject
Finds or creates a child scene object with the specified name under the given root object. It only searches the immediate children of the root object. If a child object with the specified name already exists, it is returned. Otherwise, a new scene object is created, added to the scene, and assigned the specified name.
Parameters
| Parameter | Type | Description |
|---|---|---|
rootObject | SceneObject | The root object under which to search for or create the child object. |
name | string | The name of the child object to find or create. Only exact matches are considered. |
scene | Scene | The scene in which to add the new scene object if it needs to be created. |
Returns
The found or created child scene object.