I am definitely running into some sort of problem with changing scenes.
I have paired the project back to the minimum possible, and I still can’t make head or tail of it. I’ve taken out everything except two scenes, with a single background each, and one script, which simply initializes, waits three seconds and then changes scene.
The first scene change happens OK, but then the second gets the error trace below (and it doesn’t matter which scene you start from).
Note that scene 2 appears to be initialised 7 times, and we then get 7 attempting to change to scene 1s. Then 1 Scene 1 initialisation (which I think is correct and starts to work) and then lots of errors, which I believe may be the other scene changes trying to happen, and everything just getting messed up.
I cannot for the life of me work out why this is happening, or why we get 7 (a randomish number - I’ve had as few as 4 or 5 and as many as 23 - although not since I paired the project back. It’s usually 7 or 8 now, so maybe a timing thing?
I would be very grateful for any help that anyone can offer, as I believe that this problem is all that’s standing between me and a successful prototype. Thanks!
https://playcanvas.com/editor/scene/597697
Nich
Scene 1: GiftieLoader Init GiftieLoader.js?id=11637244:22
7 Scene 1: Updating to Scene 2 go-on.js?id=11638931:14
7 Scene 2: Go-On Init go-on.js?id=11638931:23
7 Scene 2: Go-on Updating to scene 1 GiftieLoader.js?id=11637244:5
Scene 1: GiftieLoader Init
Uncaught TypeError: Cannot read property 'priority' of null
at Func.get (playcanvas-stable.dbg.js:21481)
at playcanvas-stable.dbg.js:22729
at Array.sort (/native)
at Func.sortCamerasByPriority (playcanvas-stable.dbg.js:22728)
at Func.onSetPriority (playcanvas-stable.dbg.js:22548)
at Func.fire (playcanvas-stable.dbg.js:628)
at Func.<anonymous> (playcanvas-stable.dbg.js:21474)
at Func.fire (playcanvas-stable.dbg.js:628)
at Func.set (playcanvas-stable.dbg.js:21486)
at Func.<anonymous> (playcanvas-stable.dbg.js:21445)
get @ playcanvas-stable.dbg.js:21481
(anonymous) @ playcanvas-stable.dbg.js:22729
sortCamerasByPriority @ playcanvas-stable.dbg.js:22728
onSetPriority @ playcanvas-stable.dbg.js:22548
fire @ playcanvas-stable.dbg.js:628
(anonymous) @ playcanvas-stable.dbg.js:21474
fire @ playcanvas-stable.dbg.js:628
set @ playcanvas-stable.dbg.js:21486
(anonymous) @ playcanvas-stable.dbg.js:21445
initializeComponentData @ playcanvas-stable.dbg.js:21443
initializeComponentData @ playcanvas-stable.dbg.js:22694
addComponent @ playcanvas-stable.dbg.js:21427
_openComponentData @ playcanvas-stable.dbg.js:32487
_openComponentData @ playcanvas-stable.dbg.js:32493
parse @ playcanvas-stable.dbg.js:32454
open @ playcanvas-stable.dbg.js:31617
open @ launch.js:10130
_loaded @ playcanvas-stable.dbg.js:20737
_preloadScripts @ playcanvas-stable.dbg.js:20793
(anonymous) @ playcanvas-stable.dbg.js:20746
(anonymous) @ launch.js:10120
setTimeout (async)
(anonymous) @ launch.js:10119
loadScene @ launch.js:10721
Editor.call @ launch.js:6262
load @ launch.js:10116
loadSceneHierarchy @ playcanvas-stable.dbg.js:20729
GoOn.loadScene @ go-on.js?id=11638931:38
GoOn.changeScene @ go-on.js?id=11638931:30
GoOn.update @ go-on.js?id=11638931:22
_scriptMethod @ playcanvas-stable.dbg.js:23363
_onUpdate @ playcanvas-stable.dbg.js:23400
_callComponentMethod @ playcanvas-stable.dbg.js:23627
_onUpdate @ playcanvas-stable.dbg.js:23637
fire @ playcanvas-stable.dbg.js:628
update @ playcanvas-stable.dbg.js:21411
update @ playcanvas-stable.dbg.js:20962
(anonymous) @ playcanvas-stable.dbg.js:21311
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
requestAnimationFrame (async)
(anonymous) @ playcanvas-stable.dbg.js:21305
1075playcanvas-stable.dbg.js:21481 Uncaught TypeError: Cannot read property 'enabled' of null
at Func.get (playcanvas-stable.dbg.js:21481)
at Func._callComponentMethod (playcanvas-stable.dbg.js:23624)
at Func._onUpdate (playcanvas-stable.dbg.js:23637)
at Function.fire (playcanvas-stable.dbg.js:628)
at Function.update (playcanvas-stable.dbg.js:21411)
at Application.update (playcanvas-stable.dbg.js:20962)
at playcanvas-stable.dbg.js:21311