Binds scripts to Events and executes them when triggered. Any script can access the ScriptComponent executing them through the variable script. See also: Scripting Overview, Script Events Guide.

// Bind a function to the MouthOpened event
function onMouthOpen(eventData)
{
print("mouth was opened");
}
var event = script.createEvent("MouthOpenedEvent");
event.bind(onMouthOpen);

Hierarchy (view full)

Constructors

Properties

allowMultipleInteractors: boolean = true

Determines whether one or more interactors can interactor with this interactable

api: Record<string, any>
colliders: ColliderComponent[] = []

Provides all colliders associated with this Interactable

enabled: boolean

If disabled, the Component will stop enacting its behavior.

enableInstantDrag: boolean = false
isScrollable: boolean = false

Returns if an Interactable is scrollable

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

onInteractorTriggerStart: PublicApi<InteractorEvent> = ...

Called whenever an interactor triggers an interactable

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

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
targetingMode: number = 3

Defines how an interactor can interact with this interactable. Values are: 1: Direct 2: Indirect 3: Direct/Indirect 4: Poke

transform: Transform
uniqueIdentifier: string
updatePriority: number

Accessors

Methods

  • Notifies the interactable that it is entering hover state

    Parameters

    Returns void

  • Notifies the interactable that it is exiting hover state

    Parameters

    Returns void

  • Notifies the interactable that it is still hovering

    Parameters

    Returns void

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

    Parameters

    • type: string

    Returns boolean

  • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

    Parameters

    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

    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