SplitScript reference / UnityGameObject / find
UnityGameObject.find
Method
UnityGameObject.find(path: String) -> UnityGameObject!
Finds a descendant by an exact path relative to this GameObject.
Each slash-separated segment selects one direct child. This does not perform an ambiguous recursive name search.
Parameters
path: Exact slash-separated child path to resolve.
Effects: allocates, reads process memory, requires an attached process
Runtime behavior: available while a process is attached, except in onDetach; synchronous
Examples
Resolve a nested descendant
whileAttached {
let scene = unity.scenes.active() else return
let world = scene.find("World") else return
let camera = world.find("Player/Camera") else return
print(camera.name() else "Unknown")
}