# Detect when LOD parent is selected

**URL:** <https://forum.babylonjs.com/t/detect-when-lod-parent-is-selected/5350>\
**Category:** Questions\
**Created:** [August 28, 2019, 10:16pm UTC](https://forum.babylonjs.com/t/detect-when-lod-parent-is-selected/5350 "2019-08-28T22:16:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Devin\_Wright](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/devin_wright/32/4302_2.png) [@Devin\_Wright](https://forum.babylonjs.com/u/Devin_Wright)\
**Post date:** [August 28, 2019, 10:16pm UTC](https://forum.babylonjs.com/t/detect-when-lod-parent-is-selected/5350/1 "2019-08-28T22:16:16Z")

</div>

I cannot figure out how to determine when the mesh that adds other LOD meshes to it is selected.  
It seems that when distance is less than the smallest LOD distance, the selected mesh returned is not the original mesh, but the first level.

[Here is a playground.](https://www.babylonjs-playground.com/#M36D7F#2)

I am expecting there to be a green sphere visible when the brown torus is visible.

–Edit–  
So, if I attach a `onBeforeRenderObservable` and do `knot00.getLOD(camera)` in there, it outputs the results I would expect. Perhaps this is a bug? If not, is there any performance difference between attaching to the beforeRender event vs the `onLODLevelSelection` function?

Here is a [playground](https://www.babylonjs-playground.com/#M36D7F#4) showing it working with onBeforeRenderObservable

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [August 28, 2019, 10:27pm UTC](https://forum.babylonjs.com/t/detect-when-lod-parent-is-selected/5350/2 "2019-08-28T22:27:14Z")

</div>

Nope you are right! this is a bug 🙂  
will be fix by next nightly!

Thanks a lot
