Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

214
Vistas
Javascript/SparkAR — How to access a null object inside a plane tracker using script?

I am trying to access a null object inside a plane tracker located in the Scene without success. I believe the issue is the hierarchy of the scene but, I need the plane tracker to be outside the Device (screenshot for reference). Any help is really appreciated.

Here's the scene setup: Screenshot

[Error] Warning: Possible Unhandled Promise Rejection: ReferenceError: Property 'obj0' doesn't exist

Code:

const Scene = require('Scene');

(async function () {
  const allObjs = ([
    obj0,
  ] = await Promise.all([
    Scene.root.findFirst('obj0'),
  ]));
});
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

In your example you are retrieving obj0 asynchronously, meaning you cannot expect it to be available in the next line but only once the async call has finished.

To ensure obj0 is available, either use Promise.then as in

Scene.root.findFirst('obj0').then(obj0 => {
    // obj0 is available here
});

or await it synchronously as in

const obj0 = await Scene.root.findFirst('obj0');
// obj0 is available
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda