# Sprite still pickable after scene change - multiple scenes

**URL:** <https://forum.babylonjs.com/t/sprite-still-pickable-after-scene-change-multiple-scenes/31608>\
**Category:** Bugs\
**Created:** [June 22, 2022, 9:35pm UTC](https://forum.babylonjs.com/t/sprite-still-pickable-after-scene-change-multiple-scenes/31608 "2022-06-22T21:35:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tinedol22](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@tinedol22](https://forum.babylonjs.com/u/tinedol22)\
**Post date:** [June 22, 2022, 9:35pm UTC](https://forum.babylonjs.com/t/sprite-still-pickable-after-scene-change-multiple-scenes/31608/1 "2022-06-22T21:35:12Z")

</div>

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

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

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/b/7/b7e6136408bf1fd16f99b5abf16e350ae1196183.png)

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/5/6/56337da6072f2ae3da4adb27750f329d9c73bbfc.png)  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/1/d/1d96a12ad1534469e2222debd6474bb2a63c842d.png)

Original playground: [https://playground.babylonjs.com/#MXCRPS#1](https://playground.babylonjs.com/#MXCRPS#1)  
Bug playground: [https://playground.babylonjs.com/#MXCRPS#306](https://playground.babylonjs.com/#MXCRPS#306)

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [June 22, 2022, 10:07pm UTC](https://forum.babylonjs.com/t/sprite-still-pickable-after-scene-change-multiple-scenes/31608/2 "2022-06-22T22:07:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [July 21, 2022, 12:06pm UTC](https://forum.babylonjs.com/t/sprite-still-pickable-after-scene-change-multiple-scenes/31608/3 "2022-07-21T12:06:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tinedol22](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@tinedol22](https://forum.babylonjs.com/u/tinedol22)\
**Post date:** [August 1, 2022, 12:46pm UTC](https://forum.babylonjs.com/t/sprite-still-pickable-after-scene-change-multiple-scenes/31608/4 "2022-08-01T12:46:43Z")

</div>

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.render();
    sceneEna.spriteManagers[0].isPickable = true;
    sceneDva.spriteManagers[0].isPickable = false
    scene.spriteManagers[0].isPickable = false

}

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

}

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

```

});
