Face Tracking Events

In addition to using the Anchor ID and Show Preview At Design Time parameters, the FaceTracker's Anchor Group exposes event handlers that you can use to be notified of changes in the anchors or their visibility.

Anchor Group specific Events

Event Description
onAnchorVisible Event which is emitted when an anchor (face) becomes visible in a camera frame.
onAnchorNotVisible Event which is emitted when an anchor (face) goes from being visible in the previous camera frame, to being not visible in the current frame.

Other Events

Event Description
onClick Event which is emitted when a mouse button is clicked.
onPointerDown Event which is emitted when the user touches their device (e.g. taps a button) or when a mouse button is clicked.
onPointerUp Event which is emitted when a touch or click has been released.
onPointerEnter Event which is emitted when a pointer (e.g a mouse cursor or touch input) enters the bounding area of a specific element.
onPointerMove Event which is emitted when a pointer (e.g a mouse cursor or touch input) moves within the bounding area of a specific element.
onPointerLeave Event which is emitted when a pointer (e.g a mouse cursor or touch input) exits the bounding area of a specific element.
onIntersectionEnter Event which is emitted when an individual element enters (intersects) with another individual element (e.g. Starting a 3D animation when the camera focuses on a 3D component).
onIntersectionLeave Event which is emitted when an individual element exits (intersects) another individual element (e.g. Pausing a 3D animation when the camera focuses away from a 3D component).

Using events

You can use events to increase engagement by adding interactive elements to your Mattercraft project.

You can use Behavior Actions to add such interactivity.

Next article: Face Tracking best practices

zapcode branded_zapcode i