Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm working on a game using spark ar, by following the tutorial from youtube (blinking game tutorial). apparently when I was working there was an error in the script

    const Scene = require('Scene');
    export const Diagnostics = require('Diagnostics');
    const Patches = require("Patches");

    Promise.all([
        Scene.root.findFirst('number'),]).then(onReady);

    function onReady(assets) {
      var counterNumber = assets[0];
      var scoreNumber = p.outputs.getScalar("score");

      scoreNumber.then(e => {
        e.monitor().subscribe(value => {
          counterNumber.text = value.newValue.toString();
        });
      });
    }

Error : Possible Unhandled Promise Rejection: ReferenceError: Property 'p' doesn't exist

question from:https://stackoverflow.com/questions/65952779/how-to-solve-javascript-unhandled-promise-rejection-and-property-p-doesnt

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.4k views
Welcome To Ask or Share your Answers For Others

1 Answer

create a const P as below and check whether its working or not

const Scene = require('Scene');
const P = require('Patches');

reference taken from Score Didnt show up (Spark AR)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...