Skip to main content

Events

Events are triggered by certain criteria and can be bound in scripts to execute code. See also: Script Events Guide

BrowsLoweredEvent

Triggered when eyebrows are lowered on the tracked face.

Lens Studio v1.5.0+
Scripting Name: BrowsLoweredEvent
Inherits from FaceTrackingEvent

BrowsRaisedEvent

Triggered when eyebrows are raised on the tracked face.

Lens Studio v1.5.0+
Scripting Name: BrowsRaisedEvent
Inherits from FaceTrackingEvent

BrowsReturnedToNormalEvent

Triggered when eyebrows are returned to normal on the tracked face.

Lens Studio v1.5.0+
Scripting Name: BrowsReturnedToNormalEvent
Inherits from FaceTrackingEvent

CameraBackEvent

Triggered when the device's back facing camera becomes active.

Lens Studio v1.0.0+
Scripting Name: CameraBackEvent
Inherits from SceneEvent

CameraFrontEvent

Triggered when the device's front facing camera becomes active.

Lens Studio v1.0.0+
Scripting Name: CameraFrontEvent
Inherits from SceneEvent

ConnectedLensEnteredEvent

Event fired when the "Launch connected lens" button was pressed. Wait for this event to be triggered before creating a session, as having this event gaurantees the user has accepted the necessary disclosures to use a connected lens experience.

Lens Studio v4.0+
Scripting Name: ConnectedLensEnteredEvent
Inherits from SceneEvent

DelayedCallbackEvent

An event that gets triggered after a delay.

Lens Studio v1.0.0+
Scripting Name: DelayedCallbackEvent
Inherits from SceneEvent

FaceFoundEvent

Triggered when a new face is detected and starts being tracked.

Lens Studio v1.5.0+
Scripting Name: FaceFoundEvent
Inherits from FaceTrackingEvent

FaceLostEvent

Triggered when a face can no longer be tracked. For example, if a face gets blocked from the camera's view, or gets too far away.

Lens Studio v1.5.0+
Scripting Name: FaceLostEvent
Inherits from FaceTrackingEvent

FaceTrackingEvent

This is the base class for all face tracking events. This event won't actually get triggered itself, so use one of the child classes instead.

Lens Studio v1.5.0+
Scripting Name: FaceTrackingEvent
Inherits from SceneEvent

HoverEvent

Triggered when a mouse hover event occurs. Only triggered in the Preview panel of Lens studio. Useful when working with Spectacles, where you can simulate the use of your hand to hover over an object. Does not get triggered on mobile.

Lens Studio v5.0.20+
Scripting Name: HoverEvent
Inherits from SceneObjectEvent

IEventParameters

The base class for parameter objects passed into event callbacks.

Lens Studio v1.0.0+
Scripting Name: IEventParameters
Inherits from ScriptObject
Child Classes: SceneEvent

KissFinishedEvent

Triggered when the tracked face ends a kiss.

Lens Studio v1.5.0+
Scripting Name: KissFinishedEvent
Inherits from FaceTrackingEvent

KissStartedEvent

Triggered when the tracked face starts a kiss.

Lens Studio v1.5.0+
Scripting Name: KissStartedEvent
Inherits from FaceTrackingEvent

LateUpdateEvent

This event is triggered at the end of every frame, after normal UpdateEvents trigger but before rendering occurs.

Lens Studio v1.0.0+
Scripting Name: LateUpdateEvent
Inherits from SceneEvent

ManipulateEndEvent

This event is triggered when manipulation on the object ends.

Lens Studio v1.0.0+
Scripting Name: ManipulateEndEvent
Inherits from SceneObjectEvent

ManipulateStartEvent

This event is triggered when manipulation on the object begins.

Lens Studio v1.0.0+
Scripting Name: ManipulateStartEvent
Inherits from SceneObjectEvent

MouthClosedEvent

Triggered when the tracked face's mouth closes.

Lens Studio v1.5.0+
Scripting Name: MouthClosedEvent
Inherits from FaceTrackingEvent

MouthOpenedEvent

Triggered when the tracked face's mouth opens.

Lens Studio v1.5.0+
Scripting Name: MouthOpenedEvent
Inherits from FaceTrackingEvent

OnAwakeEvent

Triggered when the Lens starts, earlier than all OnStart events. Also fires immediately on a newly instantiated or copied object.

Lens Studio v4.0+
Scripting Name: OnAwakeEvent
Inherits from SceneEvent

OnDestroyEvent

Triggered when the associated ScriptComponent is destroyed while the lens is running.

Lens Studio v4.13.0+
Scripting Name: OnDestroyEvent
Inherits from SceneEvent

OnDisableEvent

Triggered when the ScriptComponent this event is bound to is disabled.

Lens Studio v4.22.0+
Scripting Name: OnDisableEvent
Inherits from SceneEvent

OnEnableEvent

Triggered when the ScriptComponent this event is bound to is enabled.

Lens Studio v4.22.0+
Scripting Name: OnEnableEvent
Inherits from SceneEvent

OnStartEvent

Triggered when the Lens starts, after all OnAwakeEvents have triggered. Also triggers later on newly instantiated or copied objects.

Lens Studio v4.0+
Scripting Name: OnStartEvent
Inherits from SceneEvent

SceneObjectEvent

Base class for all object-based Event types in Lens Studio (ManipulateStartEvent, TapEvent, etc.).

Lens Studio v1.0.0+
Scripting Name: SceneObjectEvent
Inherits from SceneEvent

SmileFinishedEvent

Triggered when a smile ends on the tracked face.

Lens Studio v1.5.0+
Scripting Name: SmileFinishedEvent
Inherits from FaceTrackingEvent

SmileStartedEvent

Triggered when a smile begins on the tracked face.

Lens Studio v1.5.0+
Scripting Name: SmileStartedEvent
Inherits from FaceTrackingEvent

SnapImageCaptureEvent

Called when the user taps on the capture button to record an image.

Lens Studio v4.0+
Scripting Name: SnapImageCaptureEvent
Inherits from SceneEvent

SnapRecordStartEvent

Gets called when the user starts long pressing the capture button to record a Snap.

Lens Studio v4.0+
Scripting Name: SnapRecordStartEvent
Inherits from SceneEvent

SnapRecordStopEvent

Gets called when the user stops long pressing the Snap button to end recording of a Snap.

Lens Studio v4.0+
Scripting Name: SnapRecordStopEvent
Inherits from SceneEvent

TapEvent

This event is triggered when the user taps on the screen.

Lens Studio v1.0.0+
Scripting Name: TapEvent
Inherits from SceneObjectEvent

TouchEndEvent

Triggered when a touch event ends.

Lens Studio v1.0.0+
Scripting Name: TouchEndEvent
Inherits from SceneObjectEvent

TouchMoveEvent

Triggered when a touch position on the screen is moved.

Lens Studio v1.0.0+
Scripting Name: TouchMoveEvent
Inherits from SceneObjectEvent

TouchStartEvent

Triggered when a touch event starts.

Lens Studio v1.0.0+
Scripting Name: TouchStartEvent
Inherits from SceneObjectEvent

TriggerPrimaryEvent

Gets called when the user triggers the primary input on their device. For example touch on touch screens.

Lens Studio v4.0+
Scripting Name: TriggerPrimaryEvent
Inherits from SceneObjectEvent

TurnOffEvent

Triggered when the lens turns off.

Lens Studio v1.0.0+
Scripting Name: TurnOffEvent
Inherits from SceneEvent

[DEPRECATED] TurnOnEvent

This event has been deprecated, please use the OnStartEvent instead.

Triggered when the lens turns on.

Lens Studio v1.0.0+
Scripting Name: TurnOnEvent
Inherits from SceneEvent

UpdateEvent

Triggered every frame.

Lens Studio v1.0.0+
Scripting Name: UpdateEvent
Inherits from SceneEvent

WorldTrackingMeshesAddedEvent

Triggered when new world tracking meshes are detected. Only available when a Device Tracking component is in the scene, and world mesh tracking is supported and enabled.

Lens Studio v3.2+
Scripting Name: WorldTrackingMeshesAddedEvent
Inherits from SceneEvent

WorldTrackingMeshesRemovedEvent

Triggered when some world tracking meshes are no longer detected. Only available when a Device Tracking component is in the scene, and world mesh tracking is supported and enabled.

Lens Studio v3.2+
Scripting Name: WorldTrackingMeshesRemovedEvent
Inherits from SceneEvent

WorldTrackingMeshesUpdatedEvent

Triggered when world tracking meshes are updated. Only available when a Device Tracking component is in the scene, and world mesh tracking is supported and enabled.

Lens Studio v3.2+
Scripting Name: WorldTrackingMeshesUpdatedEvent
Inherits from SceneEvent

WorldTrackingPlanesAddedEvent

Triggered when plane(s) are newly detected. The worldOptions.nativePlaneTrackingType must be set to anything other than NativePlaneTrackingType.None. In addition, Device Tracking component must be set to World mode to orient the Camera relative to the planes correctly.

Lens Studio v3.4+
Scripting Name: WorldTrackingPlanesAddedEvent
Inherits from SceneEvent

WorldTrackingPlanesRemovedEvent

Triggered when plane(s) are no longer detected. This usually happens when two planes merge into one. Planes persist when no longer seen by camera(s) and when previously detected objects move (e.g. a door is opened) to create a static scene. Device Tracking component must be set to World mode to orient the Camera relative to the planes correctly.

Lens Studio v3.4+
Scripting Name: WorldTrackingPlanesRemovedEvent
Inherits from SceneEvent

WorldTrackingPlanesUpdatedEvent

Triggered when currently detected plane(s) are updated. This usually happens when a plane grows in size. The worldOptions.nativePlaneTrackingType must be set to anything other than NativePlaneTrackingType.None. In addition, Device Tracking component must be set to World mode to orient the Camera relative to the planes correctly.

Lens Studio v3.4+
Scripting Name: WorldTrackingPlanesUpdatedEvent
Inherits from SceneEvent

WorldTrackingResetEvent

If a DeviceTracking component is present in the scene, this event is triggered when the tracking is restarted (typically when the Lens starts, or if the user taps the ground).

Lens Studio v1.0.0+
Scripting Name: WorldTrackingResetEvent
Inherits from SceneEvent
Was this page helpful?
Yes
No