Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

211
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!