when i try to run the console i have the following error on the spark ar studio console. ERROR: undefined is not a function { "line": 13, "column": 25, "sourceURL": "script.js" }
import {quiz} from './quiz.js'
const Scene =require('Scene')
const Diagnostics = require('Diagnostics')
const Materials = require('Materials')
const TouchGestures = require('TouchGestures')
const root = Scene.root
let question = root.find('question')
let counter = root.find('counter')
let next = root.find('next')
let a1= root.find('a1')
let a2= root.find('a2')
let a3= root.find('a3')
let a4= root.find('a4')
let mats = [
Materials.get('answer_bg1'),
Materials.get('answer_bg2'),
Materials.get('answer_bg3'),
Materials.get('answer_bg4')
]
let rects = [
root.find('answer_bg1'),
root.find('answer_bg2'),
root.find('answer_bg3'),
root.find('answer_bg4'),
]
let answers =[]
let righAnswers=[]
let selected = 0
let questionNumber=0
let q = quiz[questionNumber]
question.text=q.question
Starting from v85 of Spark AR Studio the current JavaScript APIs are deprecated in favor of asynchronous APIs.
This means some APIs will be deprecated and will need to be replaced in your projects. When creating new projects, new APIs should be used instead.
You can learn more about it here Scripting Javascript Promise In Spark AR For Beginners
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.