Lens Scripting API
    Preparing search index...
    • [ByKey] Finds all Components of a given type in the parents of a SceneObject, searching recursively upwards.

      Type Parameters

      Parameters

      • sceneObject: SceneObject

        The SceneObject to start the search from.

      • componentType: K

        The string key of the component type to find (e.g., "Component.RenderMeshVisual").

      • OptionalmaxLevels: number

        The maximum number of levels to search up the hierarchy.

      Returns ComponentNameMap[K][]

      An array of all matching Components found.

    • [ByScriptType] Finds all Components of a given script type in the parents of a SceneObject, searching recursively upwards.

      Type Parameters

      Parameters

      • sceneObject: SceneObject

        The SceneObject to start the search from.

      • componentType: TypeName<T>

        The script type name (e.g., Interactable.getTypeName())) to find.

      • OptionalmaxLevels: number

        The maximum number of levels to search up the hierarchy.

      Returns T[]

      An array of all matching Components found.