# debugLayer.onPropertyChangedObservable not firing when enabling / disabling lights

**URL:** <https://forum.babylonjs.com/t/debuglayer-onpropertychangedobservable-not-firing-when-enabling-disabling-lights/42184>\
**Category:** Questions\
**Created:** [July 5, 2023, 8:22pm UTC](https://forum.babylonjs.com/t/debuglayer-onpropertychangedobservable-not-firing-when-enabling-disabling-lights/42184 "2023-07-05T20:22:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anupam\_Das](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/anupam_das/32/16709_2.png) [@Anupam\_Das](https://forum.babylonjs.com/u/Anupam_Das)\
**Post date:** [July 5, 2023, 8:22pm UTC](https://forum.babylonjs.com/t/debuglayer-onpropertychangedobservable-not-firing-when-enabling-disabling-lights/42184/1 "2023-07-05T20:22:05Z")

</div>

debugLayer.onPropertyChangedObservable is not firing when enabling disabling lights in the BJS inspector. wonder if this is a bug or feature? is there another event i can watch when a user enables/disables lighting?

---

<div class="post-metadata">

**Author:** ![Takemura](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/takemura/32/25836_2.png) [@Takemura](https://forum.babylonjs.com/u/Takemura)\
**Post date:** [July 5, 2023, 9:37pm UTC](https://forum.babylonjs.com/t/debuglayer-onpropertychangedobservable-not-firing-when-enabling-disabling-lights/42184/2 "2023-07-05T21:37:46Z")

</div>

The enabled state change of a lightTreeItemComponent

> <https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/inspector/src/components/sceneExplorer/entities/lightTreeItemComponent.tsx#L62>

is handled differently than i.e. transform nodes by the inspector, so that it does not trigger/notify `onPropertyChanged`-observers.

> <https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/inspector/src/components/actionTabs/tabs/propertyGrids/meshes/meshPropertyGridComponent.tsx#L445>

Maybe our experts @carolhmj @RaananW @sebavan know if it can/should be included.

Currently a possibility is to use onEnabledStateChangedObservable of your lights:

> **[Light | Babylon.js Documentation](https://doc.babylonjs.com/typedoc/classes/BABYLON.Light#onEnabledStateChangedObservable)**
>
> Base class of all the lights in Babylon. It groups all the generic information about lights.Lights are used, as you would expect, to affect how meshe

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [July 6, 2023, 11:44am UTC](https://forum.babylonjs.com/t/debuglayer-onpropertychangedobservable-not-firing-when-enabling-disabling-lights/42184/3 "2023-07-06T11:44:10Z")

</div>

Makes sense to me to add that (in the right place)  
@carolhmj - do you have the time? 🙂  
If not i’ll take care of that later.

---

<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 6, 2023, 3:47pm UTC](https://forum.babylonjs.com/t/debuglayer-onpropertychangedobservable-not-firing-when-enabling-disabling-lights/42184/4 "2023-07-06T15:47:24Z")

</div>

I can do that sure 😃

---

<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 6, 2023, 3:59pm UTC](https://forum.babylonjs.com/t/debuglayer-onpropertychangedobservable-not-firing-when-enabling-disabling-lights/42184/5 "2023-07-06T15:59:21Z")

</div>



---

<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 6, 2023, 5:27pm UTC](https://forum.babylonjs.com/t/debuglayer-onpropertychangedobservable-not-firing-when-enabling-disabling-lights/42184/6 "2023-07-06T17:27:28Z")

</div>

PR here: [[Inspector] When changing relevant properties on the Camera, Light an… by carolhmj · Pull Request #14028 · BabylonJS/Babylon.js (github.com)](https://github.com/BabylonJS/Babylon.js/pull/14028)

---

<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 7, 2023, 12:24pm UTC](https://forum.babylonjs.com/t/debuglayer-onpropertychangedobservable-not-firing-when-enabling-disabling-lights/42184/7 "2023-07-07T12:24:28Z")

</div>


