Search code examples
javascriptaugmented-realityspark-ar-studio

Parent an object to a face tracker with a delay in Spark AR Studio?


Hi I'm an animator new to coding I was wondering if it was possible to parent an object to the face tracker but with a short delay of 200 milliseconds or so, I have tried in the patches editor and with a script but have hit brick walls both times. Thanks for your help! :)


Solution

  • I think what you're looking for is the expSmooth() method:
    https://sparkar.facebook.com/ar-studio/learn/reference/classes/reactivemodule

    For example:

    let dampening = 1000;
    myObject.transform = face.cameraTransform.expSmooth(dampening);