Skip to content
Open page
Extension guide

Face Sensing

Detect a face with your camera, move sprites to features such as the nose, eyes and mouth, or trigger scripts when the face tilts.

Getting started

  1. Add the extension and allow the editor to use your camera.
  2. Face the camera with your face clearly visible.
  3. Repeatedly run “go to nose” in a sprite, or use a face-tilt event to start a script.

Face Sensing detects positions and landmarks. It does not identify who a person is.

Detection results

  • When several faces are visible, the current implementation uses the first face in the detection results.
  • Tilt uses Scratch’s direction convention, with a front-facing face close to 90 degrees.
  • Face size is an approximation derived from the detected bounding box width. The top-of-head position is also estimated.
  • When no face is detected, the detection Boolean returns false. Tilt and size reporters retain their most recent values, or 0 before the first detection.

Camera and browser

The browser needs WebGL, WebAssembly SIMD and camera support. Open the editor over HTTPS or localhost. Denying camera access prevents usable detection results.

The model and runtime dependencies are embedded in the built extension script, making it substantially larger than a typical extension. Loading the extension does not fetch the model from the original dependency CDN. Detection runs in the browser; this implementation does not upload camera frames.

If the extension shows “Could not load face detection”, check browser support and the developer console. Model initialization can also fail, so this message does not always mean a camera permission problem.

Compatibility and source

The faceSensing ID and lab/face-sensing.js path are preserved. This is TurboWarp’s Scratch Lab compatible implementation, by GarboMuffin. The runtime source is unchanged from upstream; Blockdia maintains these instructions and the Simplified Chinese translations. Only sprite targets are currently declared. Containers, components and nonstandard stage sizes still need dedicated validation.

Attribution and licenses

Source: extensions · lab/face-sensing · 0.1.0 · f05ab05fa1d2