0

I am using a face tracker to place a rectangle of texture on my scene. When the user is too far back, the rectangle disappears. I believe this is because the object is passing through some of the layers and becoming obscured.

What I would like to do is add reactional instructions to "move camera closer" when the user is a certain distance away from the camera. Is there a way to ascertain the users distance on the z axis and trigger the instruction visibility?

Here is a snippet of what I have been trying to script.

// Load in the required modules
const FaceTracking = require('FaceTracking');
const Reactive = require('Reactive');

// Gather Face Tracker
const face = FaceTracking.face(0);

var show = face.cameraTransform.z.gt(someNumber);

Instruction.bind(show, 'move_camera_closer');
Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278

1 Answers1

0

This code snipped above actually does function as expected.

My issue was in scale, not functionality. Originally the value of "someNumber" was far too small. Adjusting the value from -5 to -.5 allowed the code to function as expected.