I have a dummyScene that just holds some meshes and sounds. I just updated babylonjs to alpha.21 before i did not have a camera on my dummy scene, now i get a runtime error :
Uncaught Error: Active camera not set
at t.a.a.createPickingRayToRef (babylon.js:16)
at babylon.js:16
at t.a.a._internalPick (babylon.js:16)
at t.a.a.pick (babylon.js:16)
at t._initActionManager (babylon.js:16)
at t._initClickEvent (babylon.js:16)
at _onPointerUp (babylon.js:16)
So if i make a dummy camera, this error goes away.
Is there a way around this? I dont need the dummy camera at all. Is there a way to do this without creating another object that wont be used?
This should not happen if you are not attaching controls or trying to render this scene. Calling AttachControl is the only way _onPointerUp would get called.
I ask because i have not gotten this error before and had not changed any code between the tests and the updates. So this would seem like an error with one of the two versions.
Let alone as far as i know there are no controls on this scene and im not rendering it. So this is very strange.
I use the dummy scene to preload images, meshes and sounds etc… Then i use some of those images for gui in my real scenes. Maybe something is causing them to not be updated to the new scene.
I also have some home grown babylonjs modules (that i hope someday i can commit to the greater babylon ) they seem to work but throw compile errors. (Can still run with these…). The one in question being circle button, which is and extension of ellipse… https://www.babylonjs-playground.com/#EJX0YB#1 (seems to work fine though)
It only happens on pointer up, never anywhere else, not onPointerDown. Which is very strange.
I can console.log(scene) then when i click, the console shows the scene object(and the corresponding error that i put in the initial post). I can then expand it, and expand active camera to show my current camera…
So my current scene that has the onPointerUp has a active camera.
It seems as though this error is more challenging to suppress than i thought. As i am on version .17, and after switching through scenes, creating, and disposing i get the error again. This could be because of bad logic. However it works perfectly on version 8.
It seems for now i should just stay on 8 as it has no problems, where the only reason i have to update is ninepatch… i could get around it…
Yeah i was thinking that but for not its just too much to handle. Hopefully we will be able to figure it out.
Could it have anything to do with my assetloader being on the dummy scene, then calling those assets in other scenes? Such as
assetloader loads(sounds, images, textures)(on the dummy scene)
then the image from the dummy scene is used on a regular scenes GUI, with onclick events…
this is the only reason i could think it might be happening.
Click the scene and you get the error in the console(developer console). I tried to make this perfect as close as i could get to the original but as small as possible.
So i have a dummy scene that load/ and would regularly store the image asset. Then i use that image asset in the main scene. However i get this error:
“babylon.js:16 Uncaught Error: Active camera not set”
when clicking anywhere in the scene.