# Synchronize visibility of GUI controls linked with mesh

**URL:** <https://forum.babylonjs.com/t/synchronize-visibility-of-gui-controls-linked-with-mesh/63853>\
**Category:** Questions\
**Tags:** gui\
**Created:** [July 23, 2026, 12:11pm UTC](https://forum.babylonjs.com/t/synchronize-visibility-of-gui-controls-linked-with-mesh/63853 "2026-07-23T12:11:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![beppemarazzi](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/beppemarazzi/32/30754_2.png) [@beppemarazzi](https://forum.babylonjs.com/u/beppemarazzi)\
**Post date:** [July 23, 2026, 12:11pm UTC](https://forum.babylonjs.com/t/synchronize-visibility-of-gui-controls-linked-with-mesh/63853/1 "2026-07-23T12:11:30Z")

</div>

In my use case i have a dynamic scene composed by dozens of meshes arranged in a hieracy.

Attached to some of them there is a TextBlock (using linkWithMesh like described here [Babylon.js docs](https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#tracking-positions))

The issue is that when the mesh with an attached label is disabled, the corresponding label remains visible.

I’m able to manage this using the onEnabledStateChangedObservable

But this doesn’t work if some of the ancestors of the mesh is disabled

Look at this minimal repro:

> **[Babylon.js Playground](https://playground.babylonjs.com/#XOMT47%231)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

IMHO the design of onEnabledStateChangedObservable is flawed because it does not reflect the “real” EnabledState. In contrast the funcion isEnabled by default does it!!!

This may be fixed with a minimal change i’m proposing here [WIP: feat(core): add onEnabledStateChangedObservableEx on Node by beppemarazzi · Pull Request #18722 · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/pull/18722)

---

<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:** [July 23, 2026, 1:56pm UTC](https://forum.babylonjs.com/t/synchronize-visibility-of-gui-controls-linked-with-mesh/63853/2 "2026-07-23T13:56:47Z")

</div>

cc @amoebachant

---

<div class="post-metadata">

**Author:** ![amoebachant](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/amoebachant/32/39450_2.png) [@amoebachant](https://forum.babylonjs.com/u/amoebachant)\
**Post date:** [July 24, 2026, 12:40am UTC](https://forum.babylonjs.com/t/synchronize-visibility-of-gui-controls-linked-with-mesh/63853/3 "2026-07-24T00:40:12Z")

</div>

Hi @beppemarazzi - thanks for reporting this and for getting a head start on the fix!

I agree that it’s confusing that onEnabledStateChangedObservable doesn’t notify when the effective enabled state changes - it only notifies when the local enabled state changes. I took a look at your PR and agree that adding a second observable makes sense, but I’d prefer if it were lazy loaded. Take a look at my draft PR here: [Add onEffectiveEnabledStateChangedObservable to node class by AmoebaChant · Pull Request #18726 · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/pull/18726) and let me know what you think.

Thanks again!

---

<div class="post-metadata">

**Author:** ![beppemarazzi](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/beppemarazzi/32/30754_2.png) [@beppemarazzi](https://forum.babylonjs.com/u/beppemarazzi)\
**Post date:** [July 24, 2026, 6:43am UTC](https://forum.babylonjs.com/t/synchronize-visibility-of-gui-controls-linked-with-mesh/63853/4 "2026-07-24T06:43:41Z")

</div>

Thank you @amoebachant !!!

It definitely solves the issue!!!

Here the repro playground with your fix:

> **[Babylon.js Playground](https://playground.babylonjs.com/?snapshot=refs%2Fpull%2F18726%2Fmerge#XOMT47%234)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

Thanks again!!!

---

<div class="post-metadata">

**Author:** ![amoebachant](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/amoebachant/32/39450_2.png) [@amoebachant](https://forum.babylonjs.com/u/amoebachant)\
**Post date:** [July 24, 2026, 4:14pm UTC](https://forum.babylonjs.com/t/synchronize-visibility-of-gui-controls-linked-with-mesh/63853/5 "2026-07-24T16:14:27Z")

</div>

You’re welcome, thanks for confirming it fixes it!
