Can Sprites not be picked when it is obscured by the mesh?

Can you please tell me how to make sprites unpickable when they are obscured by the mesh?


Sprites Examples | Babylon.js Playground (

I think you’ll need to make an additional call to scene.pick and check the value of pickResult.distance: if that of scene.pick is smaller than that of scene.pickSprite, then the sprite is obscured.

Thank you. Like this.

Sprites Examples | Babylon.js Playground (


You can simplify the code a little if you want:

1 Like

Thank you.