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

_interactor?: default
api: Record<string, any>
enableCursorSnapping: boolean = true
enabled: boolean

If disabled, the Component will stop enacting its behavior.

enableFilter: boolean = false
name: string
onEnableChanged: PublicApi<boolean> = ...

Called whenever the cursor changes enabled state (showing / hiding the cursor visual)

sceneObject: SceneObject

The scene object this component is on.

uniqueIdentifier: string
updatePriority: number
visual: SceneObject

Accessors

  • set cursorMode(mode): void
  • Set the CursorMode of the cursor to change the visual To return the cursor to its default StateMachine logic, use CursorMode.Auto

    Parameters

    • mode: CursorMode

      the new mode of the cursor visual

    Returns void

  • get cursorPosition(): vec3
  • Get the world position of this interactor's cursor visual

    Returns vec3

    vec3 of the worldPosition

  • set cursorPosition(position): void
  • Set the world position of this interactor's cursor visual

    Parameters

    • position: vec3

      vec3 of the worldPosition, null to revert to default behavior to follow raycast

    Returns void

  • set customTexture(texture): void
  • Set the Texture of the cursor when using the CursorMode.Custom mode Must explicitly set the CursorMode to CursorMode.Custom before the texture appears.

    Parameters

    • texture: Texture

      the custom texture (typically cached via requireAsset(.../assetName.png) as Texture) to use

    Returns void

  • get interactor(): default
  • Returns default

  • set interactor(interactor): void
  • Parameters

    Returns void

  • set renderOrder(renderOrder): void
  • Set the render order of the cursor visual.

    Parameters

    • renderOrder: number

    Returns void

Methods

  • 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