I have an X value representing how much I open my mouth in spark AR. How can I show that X value into a 2d text?
I expect the text to show the Number value while running the effect.
I have an X value representing how much I open my mouth in spark AR. How can I show that X value into a 2d text?
I expect the text to show the Number value while running the effect.
You should use this script:
const Scene = require('Scene');
// Use export keyword to make a symbol available in scripting debug console
export const Diagnostics = require('Diagnostics');
// To use variables and functions across files, use export/import keyword
// export const animationDuration = 10;
// Use import keyword to import a symbol from another file
// import { animationDuration } from './script.js'
// To access scene objects
// const directionalLight = Scene.root.find('directionalLight0');
// To access class properties
// const directionalLightIntensity = directionalLight.intensity;
// To log messages to the console
Diagnostics.log('Console message logged from the script.');
const Patches = require('Patches');
const numberFormat = '{0}';
const number = Patches.getScalarValue('number');
Patches.setStringValue('value', number.format(numberFormat));