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

333
Views
Spark AR - Can't create an Scene Object with Scene.create() method

My code is below, I'm getting a warning in console Possible unhandled promise rejection: Typeerror: undefined is not a function

The error trace will always point to Scene.create() method, even though according to the docs, is a valid call

https://sparkar.facebook.com/ar-studio/learn/reference/classes/scenemodule#methods

const Scene = require('Scene');
const D = require('Diagnostics');

(async function () {
  const sprites = [];

  for (const i = 0; i < 3; i++) {
    const dynamicSprite = await Scene.create("PlanarImage", {
        "name": `sprite${i}`,
        "width": 0.1,
        "height": 0.1,
        "x": 0,
        "y": 0,
        "hidden": true,
        'material' : 'material1'
    });

    sprites.push(dynamicSprite );
  }
})();

Things I checked:

  • that there is no other object with the same name
  • that I'm typing the class name correctly: https://sparkar.facebook.com/ar-studio/learn/reference/classes/scenemodule.planarimage
  • that there is a material1 in the project
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Solved with this answer SparkAR Dynamic instantiation doesn't work at all

Had to enable dynamic instantation in the project.

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!