Face tracking expressions
The face feature and face feature size Expressions let you use the player's face (detected through the device camera via a Mirror actor) to control values in your deck.
Face feature (position)
Returns the X or Y world-space coordinate of a facial feature. This is useful for making actors follow the player's face — for example, eyes that track where the player is looking, or objects that move with the player's nose.
Parameters
| Parameter | Description |
|---|---|
| Feature | Which facial feature to track: left eye, right eye, nose, or mouth. |
| Coordinate | Whether to return the x or y position. |
| Mirror actor | Which Mirror actor to use for camera input. If the specified actor doesn't have a Mirror behavior, the closest Mirror actor is used. |
| Offset X / Offset Y | An optional offset added to the detected position, rotated to match the face angle. Useful for placing something relative to a feature — e.g. a hat above the nose. |
The returned coordinates are in world space, accounting for the Mirror actor's position, rotation, and scale.
Face feature size
Returns the size of a facial feature. This is useful for detecting expressions — for example, detecting when the player opens their mouth or blinks.
Parameters
| Parameter | Description |
|---|---|
| Feature | Which feature size to measure: left eye, right eye, mouth height, or mouth width. |
| Mirror actor | Which Mirror actor to use for camera input. |
Eye sizes increase when the eye opens wider and decrease when it closes (useful for blink detection). Mouth height increases when the mouth opens, and mouth width increases when the player smiles.
Example uses
- Face filters: Position drawn elements (hats, glasses, mustaches) on the player's face using face feature positions with offsets.
- Expression detection: Use mouth height to detect when the player opens their mouth — trigger an action like feeding a character.
- Blink detection: Watch for eye size dropping to near zero to detect blinks.
- Face-controlled game: Use the nose position to steer a character, making a hands-free game.