Sprite still pickable after scene change - multiple scenes

I think this is a bug and shouldn’t work this way, because it is not very practical :slight_smile:

The bug: when you put sprite on a scene, and then change scene, sprite is still clickable, even if it is not seen (not sure for other clickable meshes). Lines added: 68-82; Problem can be somehow solved by:

scene.spriteManagers[0].isPickable = false when you change scene
and then set it back to true

Original playground: https://playground.babylonjs.com/#MXCRPS#1
Bug playground: https://playground.babylonjs.com/#MXCRPS#306

you should probably detach the controls of the previous scene when switching them as inputs are independent from rendering with scene.detachControl()

Hello @tinedol22 just checking in if Seb’s suggestion worked for you

I did some work-around. I didn’t detach it, but i just made items from other scenes unpickable on scene change - code is from project deployed on web not on playground,… Sorry for late answer

engine.runRenderLoop(function () {

if (numberScena == 0) {
    sceneEna.spriteManagers[0].isPickable = true;
    sceneDva.spriteManagers[0].isPickable = false
    scene.spriteManagers[0].isPickable = false


if (numberScena == 1) {
    sceneEna.spriteManagers[0].isPickable = false
    sceneDva.spriteManagers[0].isPickable = false
    scene.spriteManagers[0].isPickable = true


if (numberScena == 2) {
    sceneDva.spriteManagers[0].isPickable = true;
    sceneEna.spriteManagers[0].isPickable = false
    scene.spriteManagers[0].isPickable = false


1 Like