# Skeleton Viewer enabled by default

**URL:** <https://forum.babylonjs.com/t/skeleton-viewer-enabled-by-default/19257>\
**Category:** Bugs\
**Tags:** engine, animation\
**Created:** [March 17, 2021, 5:24pm UTC](https://forum.babylonjs.com/t/skeleton-viewer-enabled-by-default/19257 "2021-03-17T17:24:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kishore\_Venkateshan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/kishore_venkateshan/32/14941_2.png) [@Kishore\_Venkateshan](https://forum.babylonjs.com/u/Kishore_Venkateshan)\
**Post date:** [March 17, 2021, 5:24pm UTC](https://forum.babylonjs.com/t/skeleton-viewer-enabled-by-default/19257/1 "2021-03-17T17:24:35Z")

</div>

I’m using the Skeleton Viewer as shown in the demo on the [tutorial](https://doc.babylonjs.com/typedoc/classes/babylon.debug.skeletonviewer). In the [playground](http://www.babylonjs-playground.com/#1BZJVJ#8), notice in line 22, the skeleton viewer is enabled by doing

```
skeletonViewer.isEnabled = true; // Enable it

```

For my use case, I want to toggle the skeleton viewer off by default. So I tried setting isEnabled = false in this line. Turns out that this actually continues to render the skeleton. But at a later point in time (I am assuming after some initialization steps or after first render maybe?), I am able to toggle the rendering using isEnabled with no problems. Am I missing something or is this a bug?

Thanks

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [March 17, 2021, 8:38pm UTC](https://forum.babylonjs.com/t/skeleton-viewer-enabled-by-default/19257/2 "2021-03-17T20:38:44Z")

</div>

Welcome aboard!

It seems there’s a bug, `isEnabled` is `false` after construction time whereas the skeleton is visible. You should call `skeletonViewer.isEnabled = true;` and `skeletonViewer.isEnabled = false;` in a row to set the value to `false` the first time.

Pinging @Pryme8 who is the creator of the skeleton viewer.

---

<div class="post-metadata">

**Author:** ![Kishore\_Venkateshan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/kishore_venkateshan/32/14941_2.png) [@Kishore\_Venkateshan](https://forum.babylonjs.com/u/Kishore_Venkateshan)\
**Post date:** [March 17, 2021, 9:35pm UTC](https://forum.babylonjs.com/t/skeleton-viewer-enabled-by-default/19257/3 "2021-03-17T21:35:44Z")

</div>

Perfect! Thanks you Evgeni. Looking forward to the fix. Until then I will use the hack you suggested :).

---

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [March 18, 2021, 3:33pm UTC](https://forum.babylonjs.com/t/skeleton-viewer-enabled-by-default/19257/4 "2021-03-18T15:33:20Z")

</div>

If I get a chance ill fix it here, sorry I have stacked with work right now.

---

<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:** [March 18, 2021, 4:00pm UTC](https://forum.babylonjs.com/t/skeleton-viewer-enabled-by-default/19257/5 "2021-03-18T16:00:46Z")

</div>

Can you create an issue so we don’t forget about it (And I or @Evgeni_Popov will probably fix it later)

---

<div class="post-metadata">

**Author:** ![Knar](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/knar/32/14900_2.png) [@Knar](https://forum.babylonjs.com/u/Knar)\
**Post date:** [March 19, 2021, 4:41pm UTC](https://forum.babylonjs.com/t/skeleton-viewer-enabled-by-default/19257/6 "2021-03-19T16:41:51Z")

</div>

It looks like this line short circuits if isEnabled is already false, which is set to false by default. It seems like isEnabled should default to true instead because the constructor always binds the function to draw the lines.

> <https://github.com/BabylonJS/Babylon.js/blob/0ec134aac7f4e4ae0c6c08e0f0ded8dafd3663ae/src/Debug/skeletonViewer.ts#L471>

---

<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:** [March 19, 2021, 5:41pm UTC](https://forum.babylonjs.com/t/skeleton-viewer-enabled-by-default/19257/7 "2021-03-19T17:41:41Z")

</div>

Will fix that!

---

<div class="post-metadata">

**Author:** ![Knar](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/knar/32/14900_2.png) [@Knar](https://forum.babylonjs.com/u/Knar)\
**Post date:** [March 19, 2021, 6:30pm UTC](https://forum.babylonjs.com/t/skeleton-viewer-enabled-by-default/19257/8 "2021-03-19T18:30:59Z")

</div>

Agh I was hoping to make my first open-source contribution but you already beat me to it. Stop being so good at your job 😅.
