Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

212
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda