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

api: Record<string, any>
enabled: boolean

If disabled, the Component will stop enacting its behavior.

name: string
sceneObject: SceneObject
uniqueIdentifier: string
updatePriority: number

Accessors

  • get distance(): number
  • Get how far the SceneObject will be from the user.

    Returns number

  • set distance(distance): void
  • Set how far the SceneObject will be from the user.

    Parameters

    • distance: number

    Returns void

  • get lockedPitch(): boolean
  • Get if the camera will follow when the user moves their head along the pitch-axis (looking up/down)

    Returns boolean

  • set lockedPitch(locked): void
  • Set if the camera will follow when the user moves their head along the pitch-axis (looking up/down)

    Parameters

    • locked: boolean

    Returns void

  • get lockedYaw(): boolean
  • Get if the camera will follow when the user moves their head along the yaw-axis (looking left/right)

    Returns boolean

  • set lockedYaw(locked): void
  • Set if the camera will follow when the user moves their head along the yaw-axis (looking left/right)

    Parameters

    • locked: boolean

    Returns void

  • get pitchBufferDegrees(): number
  • Get how many degrees of leeway along each direction (up/down) before change starts to occur.

    Returns number

  • set pitchBufferDegrees(degrees): void
  • Set how many degrees of leeway along each direction (up/down) before change starts to occur.

    Parameters

    • degrees: number

    Returns void

  • get pitchEasing(): number
  • Get how fast the camera will follow along the pitch-axis, 0.1 for delayed follow, 1 for instant follow.

    Returns number

  • set pitchEasing(easing): void
  • Set how fast the camera will follow along the pitch-axis, 0.1 for delayed follow, 1 for instant follow.

    Parameters

    • easing: number

    Returns void

  • get pitchOffsetDegrees(): number
  • Get how many degrees of offset from the center point should the target sit. Positive values place the element below the center.

    Returns number

  • set pitchOffsetDegrees(degrees): void
  • Set how many degrees of offset from the center point should the target sit. Positive values place the element below the center.

    Parameters

    • degrees: number

    Returns void

  • get translationBuffer(): number
  • Get the magnitude of change (in centimeters) needed to activate a translation for the target to follow the user's head translation.

    Returns number

  • set translationBuffer(buffer): void
  • Set the magnitude of change (in centimeters) needed to activate a translation for the target to follow the user's head translation. To keep the SceneObject from 'wobbling' when the user has an unstable head, a small buffer is recommended rather than 0.

    Parameters

    • buffer: number

    Returns void

  • get xzEasing(): number
  • Get how fast the camera will follow along the XZ-plane, 0.1 for delayed follow, 1 for instant follow.

    Returns number

  • set xzEasing(easing): void
  • Set how fast the camera will follow along the XZ-plane, 0.1 for delayed follow, 1 for instant follow.

    Parameters

    • easing: number

    Returns void

  • get xzEnabled(): boolean
  • Get if the camera will follow when the user moves their head along XZ-plane. For most cases, this should stay enabled.

    Returns boolean

  • set xzEnabled(enabled): void
  • Sets if the camera will follow when the user moves their head along XZ-plane. For most cases, this should stay enabled.

    Parameters

    • enabled: boolean

    Returns void

  • get yawBufferDegrees(): number
  • Get how many degrees of leeway along each direction (left/right) before change starts to occur.

    Returns number

  • set yawBufferDegrees(degrees): void
  • Set how many degrees of leeway along each direction (left/right) before change starts to occur.

    Parameters

    • degrees: number

    Returns void

  • get yawEasing(): number
  • Get how fast the camera will follow along the yaw-axis, 0.1 for delayed follow, 1 for instant follow.

    Returns number

  • set yawEasing(easing): void
  • Set how fast the camera will follow along the yaw-axis, 0.1 for delayed follow, 1 for instant follow.

    Parameters

    • easing: number

    Returns void

  • get yawOffsetDegrees(): number
  • Get how many degrees of offset from the center point should the target sit. Positive values place the element to the left.

    Returns number

  • set yawOffsetDegrees(degrees): void
  • Set how many degrees of offset from the center point should the target sit. Positive values place the element to the left.

    Parameters

    • degrees: number

    Returns void

  • get yEasing(): number
  • Get how fast the camera will follow along the Y-axis, 0.1 for delayed follow, 1 for instant follow.

    Returns number

  • set yEasing(easing): void
  • Set how fast the camera will follow along the Y-axis, 0.1 for delayed follow, 1 for instant follow.

    Parameters

    • easing: number

    Returns void

  • get yEnabled(): boolean
  • Get if the camera will follow when the user moves their head along Y-axis. For most cases, this should stay enabled.

    Returns boolean

  • set yEnabled(enabled): void
  • Set if the camera will follow when the user moves their head along Y-axis. For most cases, this should stay enabled.

    Parameters

    • enabled: boolean

    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

  • Snaps the object to its exact desired position, regardless of easing, unlocks, buffers, etc. Should be used after modifying values that affect the desired position (such as offset, distance) to snap the object into place without having a strange path.

    Returns void