Is Blink Detection possible on Studio?

How Can I detect a blink, using script in the Studio? Is it possible to detect?

Yes! Make a custom component with the following code, and add it to your face object.

import * as ecs from '@8thwall/ecs'

ecs.registerComponent({
  name: 'blink-detect',
  schema: {
  },
  schemaDefaults: {
  },
  data: {
  },
  add: (world, component) => {
    // https://www.8thwall.com/docs/api/facecontroller/pipelinemodule/

    world.events.addListener(world.events.globalId, 'facecontroller.blinked', (e: any) => {
      console.log('blinked')
    })
  },
  tick: (world, component) => {
  },
  remove: (world, component) => {
  },
})
2 Likes

Thank you @GeorgeButler

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.