Lens Scripting API
    Preparing search index...

    This class represents an interactable object that can respond to various interaction events such as hover, trigger, and drag. It provides event handlers for these interactions and uses the InteractionConfigurationProvider for configuration.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    acceptableXDirections: number = 0

    Controls from which directions a poke interaction can trigger this Interactable along the X-axis:

    • Left: Finger must approach from -X direction.
    • Right: Finger must approach from +X direction.
    • All: Accepts both directions.
    • None: Disables X-axis poke detection.
    acceptableYDirections: number = 0

    Controls from which directions a poke interaction can trigger this Interactable along the Y-axis:

    • Top: Finger must approach from +Y direction
    • Bottom: Finger must approach from -Y direction
    • All: Accepts both directions
    • None: Disables Y-axis poke detection
    acceptableZDirections: number = 1

    Controls from which directions a poke interaction can trigger this Interactable along the Z-axis:

    • Front: Finger must approach from +Z direction.
    • Back: Finger must approach from -Z direction.
    • All: Accepts both directions.
    • None: Disables Z-axis poke detection.
    allowMultipleInteractors: boolean = true

    Determines whether this Interactable can be simultaneously controlled by multiple Interactors. When false, only one Interactor type (e.g., left hand or right hand) can interact with this Interactable at a time, and subsequent interaction attempts from different Interactors will be blocked. Set to true to enable interactions from multiple sources simultaneously, such as allowing both hands to manipulate the Interactable at once.

    api: Record<string, any>

    Generic object accessible by other instances of ScriptComponent. Use this object to store references to properties and methods that need to be accessible from other ScriptComponents.

    colliders: ColliderComponent[] = []

    Provides all colliders associated with this Interactable.

    enabled: boolean

    If disabled, the Component will stop enacting its behavior.

    enableInstantDrag: boolean = false

    Enable this to allow the Interactable to instantly be dragged on trigger rather than obeying the Interactor's drag threshold.

    enablePokeDirectionality: boolean = false

    Enable Poke Directionality to help prevent accidental interactions when users approach from unwanted angles.

    ignoreInteractionPlane: boolean = false

    When enabled, this Interactable ignores any parent InteractionPlane and factors into the cursor's position and targetingVisual. Use when the Interactable is parented for organization but not spatially within that plane.

    isEnabledInHierarchy: boolean

    Returns true if this Component, its SceneObject, and all of that SceneObjects parents are enabled.

    isScrollable: boolean = false

    A flag that enables scroll interactions when this element is interacted with. When true, interactions with this element can scroll a parent ScrollView that has content extending beyond its visible bounds.

    keepHoverOnTrigger: boolean = false

    Defines the singular source of truth for feedback + UI + cursor components to poll to check if the Interactable should exhibit sticky behavior during trigger (cursor locks on Interactable, remains in active visual state even after de-hovering).

    name: string
    onDragEnd: PublicApi<DragInteractorEvent> = ...

    Called when an interactor was in a down event with this interactable and was dragging.

    onDragStart: PublicApi<DragInteractorEvent> = ...

    Called when an interactor is in a down event with this interactable and has moved a minimum drag distance.

    onDragUpdate: PublicApi<DragInteractorEvent> = ...

    Called when an interactor is in a down event with this interactable and is moving.

    onHoverEnter: PublicApi<InteractorEvent> = ...

    Called whenever the interactable enters the hovered state.

    onHoverExit: PublicApi<InteractorEvent> = ...

    Called whenever the interactable is no longer hovered.

    onHoverUpdate: PublicApi<InteractorEvent> = ...

    Called whenever an interactor remains hovering over this interactable.

    onInteractorHoverEnter: PublicApi<InteractorEvent> = ...

    Called whenever a new interactor hovers over this interactable.

    onInteractorHoverExit: PublicApi<InteractorEvent> = ...

    Called whenever an interactor exits hovering this interactable.

    onInteractorTriggerEnd: PublicApi<InteractorEvent> = ...

    Called whenever an interactor is no longer triggering the interactable while the interactor is hovering it.

    onInteractorTriggerEndOutside: PublicApi<InteractorEvent> = ...

    Called whenever an interactor is no longer triggering the interactable while the interactor is not hovering it.

    onInteractorTriggerStart: PublicApi<InteractorEvent> = ...

    Called whenever an interactor triggers an interactable.

    onSyncDragEnd: PublicApi<DragInteractorEvent> = ...

    Called when an interactor was in a down event with this interactable and was dragging from another connection.

    onSyncDragStart: PublicApi<DragInteractorEvent> = ...

    Called when an interactor is in a down event with this interactable and has moved a minimum drag distance from another connection.

    onSyncDragUpdate: PublicApi<DragInteractorEvent> = ...

    Called when an interactor is in a down event with this interactable and is moving from another connection.

    onSyncHoverEnter: PublicApi<InteractorEvent> = ...

    Called whenever the interactable enters the hovered state from another connection.

    onSyncHoverExit: PublicApi<InteractorEvent> = ...

    Called whenever the interactable is no longer hovered from another connection.

    onSyncHoverUpdate: PublicApi<InteractorEvent> = ...

    Called whenever an interactor remains hovering over this interactable from another connection.

    onSyncInteractorHoverEnter: PublicApi<InteractorEvent> = ...

    Called whenever a new interactor hovers over this interactable from another connection.

    onSyncInteractorHoverExit: PublicApi<InteractorEvent> = ...

    Called whenever an interactor exits hovering this interactable from another connection.

    onSyncInteractorTriggerEnd: PublicApi<InteractorEvent> = ...

    Called whenever an interactor is no longer triggering the interactable while the interactor is hovering it from another connection.

    onSyncInteractorTriggerEndOutside: PublicApi<InteractorEvent> = ...

    Called whenever an interactor is no longer triggering the interactable while the interactor is not hovering it from another connection.

    onSyncInteractorTriggerStart: PublicApi<InteractorEvent> = ...

    Called whenever an interactor triggers an interactable from another connection.

    onSyncTriggerCanceled: PublicApi<InteractorEvent> = ...

    Called whenever an interactor is lost and was in a down event with this interactable from another connection.

    onSyncTriggerEnd: PublicApi<InteractorEvent> = ...

    Called whenever the interactable exits the triggered state while the interactor is hovering it from another connection.

    onSyncTriggerEndOutside: PublicApi<InteractorEvent> = ...

    Called whenever the interactable exits the triggered state while the interactor is not hovering it from another connection.

    onSyncTriggerStart: PublicApi<InteractorEvent> = ...

    Called whenever the interactable enters the triggered state from another connection.

    onSyncTriggerUpdate: PublicApi<InteractorEvent> = ...

    Called whenever an interactor continues to trigger an interactable from another connection.

    onTriggerCanceled: PublicApi<InteractorEvent> = ...

    Called whenever an interactor is lost and was in a down event with this interactable.

    onTriggerEnd: PublicApi<InteractorEvent> = ...

    Called whenever the interactable exits the triggered state while the interactor is hovering it.

    onTriggerEndOutside: PublicApi<InteractorEvent> = ...

    Called whenever the interactable exits the triggered state while the interactor is not hovering it.

    onTriggerStart: PublicApi<InteractorEvent> = ...

    Called whenever the interactable enters the triggered state.

    onTriggerUpdate: PublicApi<InteractorEvent> = ...

    Called whenever an interactor continues to trigger an interactable.

    sceneObject: SceneObject

    The SceneObject this component is on.

    syncEntity: any = ...
    targetingMode: number = 3

    Defines how an interactor can interact with this interactable. Values are: 1: Direct: Only allows close pinch interactions where a hand directly touches the Interactable. 2: Indirect: Allows interactions from a distance with raycasting. 3: Direct/Indirect: Supports both direct and indirect interaction methods. 4: Poke: Enables finger poking interactions. 7: All: Supports all targeting modes (Direct, Indirect, and Poke).

    targetingVisual: number = TargetingVisual.Cursor

    Sets the preferred targeting visual. (Requires the V2 Cursor to be enabled on InteractorCursors).

    • 0: Cursor (default)
    • 1: Ray
    • 2: None
    uniqueIdentifier: string
    updatePriority: number
    useFilteredPinch: boolean = false

    Determines if the Interactable should listen to filtered pinch events when targeted by a HandInteractor. Filtered pinch events are more stable when the hand is quickly moving but may add latency in non-moving cases. Most interactions should use raw pinch events by default. Spatial interactions with large hand movement (such as dragging, scrolling) should use filtered pinch events. If an Interactable has a parent Interactable that uses filtered pinch events, the Interactable will also use filtered pinch events.

    Accessors

    • get triggeringConnectionId(): string

      Returns the connection ID of the first triggering Interactor if in a Connected Lens.

      Returns string

    Methods

    • Notifies the interactable that it is exiting a dragged state with the interactor

      Parameters

      Returns void

    • Notifies the interactable that it is in a dragged state with the interactor

      Parameters

      Returns void

    • Notifies the interactable that it is entering hover state

      Parameters

      Returns void

    • Parameters

      Returns boolean

      if this Interactable is a descendant of the given Interactable.

    • Returns true if the object matches or derives from the passed in type.

      Parameters

      • type: string

      Returns boolean

    • Returns void

    • Returns void

    • Notifies the interactable that it is a cancelled state with the interactor

      Parameters

      Returns void

    • Notifies the interactable that it is exiting trigger state while the interactor is hovering it

      Parameters

      Returns void

    • Notifies the interactable that it is exiting trigger state while the interactor is not hovering it.

      Parameters

      Returns void

    • Notifies the interactable that it is entering trigger state

      Parameters

      Returns void

    • Notifies the interactable that it is still in a triggering state

      Parameters

      Returns void