# Detecting occlusion on one mesh effects bounding box of another mesh

**URL:** <https://forum.babylonjs.com/t/detecting-occlusion-on-one-mesh-effects-bounding-box-of-another-mesh/29680>\
**Category:** Questions\
**Tags:** material, mesh\
**Created:** [April 25, 2022, 8:38am UTC](https://forum.babylonjs.com/t/detecting-occlusion-on-one-mesh-effects-bounding-box-of-another-mesh/29680 "2022-04-25T08:38:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ldogg](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ldogg/32/22412_2.png) [@ldogg](https://forum.babylonjs.com/u/ldogg)\
**Post date:** [April 25, 2022, 8:38am UTC](https://forum.babylonjs.com/t/detecting-occlusion-on-one-mesh-effects-bounding-box-of-another-mesh/29680/1 "2022-04-25T08:38:04Z")

</div>

Hi all! I’ve discovered an interesting but strange bug recently. Not sure what to make it of it really. In my program, I use a method to highlight the outline of an object when it is occluded but i’ve recently taken notice that when that object is occluded and the outline effect is added it also triggers what looks to be the built-in occlusion highlight effect of babylon’s bounding box on a completely different object! Not sure why that might be happening as they are two separate objects all together.

Have re-created the bug in this PG: [Babylon.js Playground](https://playground.babylonjs.com/#RIGC4Y)

Would love to hear what you you guys make of this. Not sure if I should have posted this as a question or bug so i’ve done both.

---

<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:** [April 25, 2022, 4:11pm UTC](https://forum.babylonjs.com/t/detecting-occlusion-on-one-mesh-effects-bounding-box-of-another-mesh/29680/2 "2022-04-25T16:11:22Z")

</div>

Hey there! There’s a setting on the HighlightLayer to exclude bounding boxes from the effect: [HighlightLayer | Babylon.js Documentation (babylonjs.com)](https://doc.babylonjs.com/typedoc/classes/babylon.highlightlayer#disableboundingboxesfromeffectlayer)

Setting deglows (…is that even a word?) the mesh [Occlusion of one mesh triggers bounding box effect | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#RIGC4Y#1) 😃

---

<div class="post-metadata">

**Author:** ![ldogg](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ldogg/32/22412_2.png) [@ldogg](https://forum.babylonjs.com/u/ldogg)\
**Post date:** [April 26, 2022, 7:42am UTC](https://forum.babylonjs.com/t/detecting-occlusion-on-one-mesh-effects-bounding-box-of-another-mesh/29680/3 "2022-04-26T07:42:53Z")

</div>

Thanks so much @carolhmj don’t know how i missed that flag when I looked over the docs. Setting it to true did the trick.
