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.
BrowsLoweredEvent
BrowsRaisedEvent
Triggered when eyebrows are raised on the tracked face.
BrowsRaisedEvent
BrowsReturnedToNormalEvent
Triggered when eyebrows are returned to normal on the tracked face.
BrowsReturnedToNormalEvent
CameraBackEvent
Triggered when the device's back facing camera becomes active.
CameraBackEvent
CameraFrontEvent
Triggered when the device's front facing camera becomes active.
CameraFrontEvent
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.
ConnectedLensEnteredEvent
DelayedCallbackEvent
An event that gets triggered after a delay.
DelayedCallbackEvent
FaceFoundEvent
Triggered when a new face is detected and starts being tracked.
FaceFoundEvent
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.
FaceLostEvent
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.
FaceTrackingEvent
BrowsLoweredEvent
, BrowsRaisedEvent
, BrowsReturnedToNormalEvent
, FaceFoundEvent
, FaceLostEvent
, KissFinishedEvent
, KissStartedEvent
, MouthClosedEvent
, MouthOpenedEvent
, SmileFinishedEvent
, SmileStartedEvent
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.
HoverEvent
IEventParameters
The base class for parameter objects passed into event callbacks.
IEventParameters
SceneEvent
KissFinishedEvent
Triggered when the tracked face ends a kiss.
KissFinishedEvent
KissStartedEvent
Triggered when the tracked face starts a kiss.
KissStartedEvent
LateUpdateEvent
This event is triggered at the end of every frame, after normal UpdateEvents trigger but before rendering occurs.
LateUpdateEvent
ManipulateEndEvent
This event is triggered when manipulation on the object ends.
ManipulateEndEvent
ManipulateStartEvent
This event is triggered when manipulation on the object begins.
ManipulateStartEvent
MouthClosedEvent
Triggered when the tracked face's mouth closes.
MouthClosedEvent
MouthOpenedEvent
Triggered when the tracked face's mouth opens.
MouthOpenedEvent
OnAwakeEvent
Triggered when the Lens starts, earlier than all OnStart events. Also fires immediately on a newly instantiated or copied object.
OnAwakeEvent
OnDestroyEvent
Triggered when the associated ScriptComponent is destroyed while the lens is running.
OnDestroyEvent
OnDisableEvent
Triggered when the ScriptComponent
this event is bound to is disabled.
OnDisableEvent
OnEnableEvent
Triggered when the ScriptComponent
this event is bound to is enabled.
OnEnableEvent
OnStartEvent
Triggered when the Lens starts, after all OnAwakeEvents have triggered. Also triggers later on newly instantiated or copied objects.
OnStartEvent
SceneEvent
The base class for scenewide events. SceneEvents can be created using ScriptComponent's createEvent method.
SceneEvent
CameraBackEvent
, CameraFrontEvent
, ConnectedLensEnteredEvent
, DelayedCallbackEvent
, FaceTrackingEvent
, LateUpdateEvent
, OnAwakeEvent
, OnDestroyEvent
, OnDisableEvent
, OnEnableEvent
, OnStartEvent
, SceneObjectEvent
, SnapImageCaptureEvent
, SnapRecordStartEvent
, SnapRecordStopEvent
, WorldTrackingResetEvent
, TurnOffEvent
, TurnOnEvent
, UpdateEvent
, WorldTrackingMeshesAddedEvent
, WorldTrackingMeshesRemovedEvent
, WorldTrackingMeshesUpdatedEvent
, WorldTrackingPlanesAddedEvent
, WorldTrackingPlanesRemovedEvent
, WorldTrackingPlanesUpdatedEvent
SceneObjectEvent
Base class for all object-based Event types in Lens Studio (ManipulateStartEvent, TapEvent, etc.).
SceneObjectEvent
HoverEvent
, ManipulateEndEvent
, ManipulateStartEvent
, TapEvent
, TouchEndEvent
, TouchMoveEvent
, TouchStartEvent
, TriggerPrimaryEvent
SmileFinishedEvent
Triggered when a smile ends on the tracked face.
SmileFinishedEvent
SmileStartedEvent
Triggered when a smile begins on the tracked face.
SmileStartedEvent
SnapImageCaptureEvent
Called when the user taps on the capture button to record an image.
SnapImageCaptureEvent
SnapRecordStartEvent
Gets called when the user starts long pressing the capture button to record a Snap.
SnapRecordStartEvent
SnapRecordStopEvent
Gets called when the user stops long pressing the Snap button to end recording of a Snap.
SnapRecordStopEvent
TapEvent
This event is triggered when the user taps on the screen.
TapEvent
TouchEndEvent
Triggered when a touch event ends.
TouchEndEvent
TouchMoveEvent
Triggered when a touch position on the screen is moved.
TouchMoveEvent
TouchStartEvent
Triggered when a touch event starts.
TouchStartEvent
TriggerPrimaryEvent
Gets called when the user triggers the primary input on their device. For example touch on touch screens.
TriggerPrimaryEvent
TurnOffEvent
Triggered when the lens turns off.
TurnOffEvent
[DEPRECATED] TurnOnEvent
This event has been deprecated, please use the OnStartEvent instead.
Triggered when the lens turns on.
TurnOnEvent
UpdateEvent
Triggered every frame.
UpdateEvent
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.
WorldTrackingMeshesAddedEvent
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.
WorldTrackingMeshesRemovedEvent
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.
WorldTrackingMeshesUpdatedEvent
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.
WorldTrackingPlanesAddedEvent
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.
WorldTrackingPlanesRemovedEvent
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.
WorldTrackingPlanesUpdatedEvent
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).
WorldTrackingResetEvent