# How to add a utilityLayer on the GizmoManager?

**URL:** <https://forum.babylonjs.com/t/how-to-add-a-utilitylayer-on-the-gizmomanager/6403>\
**Category:** Questions\
**Created:** [October 16, 2019, 11:11am UTC](https://forum.babylonjs.com/t/how-to-add-a-utilitylayer-on-the-gizmomanager/6403 "2019-10-16T11:11:15Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pedro\_Cristovao](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pedro_cristovao/32/2172_2.png) [@Pedro\_Cristovao](https://forum.babylonjs.com/u/Pedro_Cristovao)\
**Post date:** [October 16, 2019, 11:11am UTC](https://forum.babylonjs.com/t/how-to-add-a-utilitylayer-on-the-gizmomanager/6403/1 "2019-10-16T11:11:16Z")

</div>

How to add a utilityLayer on a GizmoManager?

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [October 16, 2019, 12:18pm UTC](https://forum.babylonjs.com/t/how-to-add-a-utilitylayer-on-the-gizmomanager/6403/2 "2019-10-16T12:18:49Z")

</div>

Each Gizmo Manager are already using their own utility layer, what are you trying to achieve ?

---

<div class="post-metadata">

**Author:** ![Pedro\_Cristovao](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pedro_cristovao/32/2172_2.png) [@Pedro\_Cristovao](https://forum.babylonjs.com/u/Pedro_Cristovao)\
**Post date:** [October 16, 2019, 1:03pm UTC](https://forum.babylonjs.com/t/how-to-add-a-utilitylayer-on-the-gizmomanager/6403/3 "2019-10-16T13:03:20Z")

</div>

I would like to change the utility layer of a GizmoManager

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [October 16, 2019, 1:30pm UTC](https://forum.babylonjs.com/t/how-to-add-a-utilitylayer-on-the-gizmomanager/6403/4 "2019-10-16T13:30:24Z")

</div>

Could you detail a bit why ? I am wondering if it is the right approach ?

---

<div class="post-metadata">

**Author:** ![Pedro\_Cristovao](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pedro_cristovao/32/2172_2.png) [@Pedro\_Cristovao](https://forum.babylonjs.com/u/Pedro_Cristovao)\
**Post date:** [October 16, 2019, 1:41pm UTC](https://forum.babylonjs.com/t/how-to-add-a-utilitylayer-on-the-gizmomanager/6403/5 "2019-10-16T13:41:36Z")

</div>

I have a react application which has two canvas, when I click on an object(1st canvas) the rotation gizmo appears as expected, however, when I click on an object(2nd canvas), the rotation gizmo appears in the first canvas instead of the second.

When debugging, I noticed that the GizmoManager.\_…utilityLayer.originalScene of the second Canvas/Scene was pointing to the first scene, hence causing the problem.

Thanks

---

<div class="post-metadata">

**Author:** ![Pedro\_Cristovao](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pedro_cristovao/32/2172_2.png) [@Pedro\_Cristovao](https://forum.babylonjs.com/u/Pedro_Cristovao)\
**Post date:** [October 16, 2019, 1:53pm UTC](https://forum.babylonjs.com/t/how-to-add-a-utilitylayer-on-the-gizmomanager/6403/6 "2019-10-16T13:53:10Z")

</div>

I could solve the issue by using a RotationGizmo instead of a GizmoManager.

I add different utilityLayers in each RotationGizmo(one gizmo per scene/canvas).

Nonetheless, I wonder if we could change the utilityLayer for a GizmoManager?

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [October 16, 2019, 1:56pm UTC](https://forum.babylonjs.com/t/how-to-add-a-utilitylayer-on-the-gizmomanager/6403/7 "2019-10-16T13:56:50Z")

</div>

> [@Pedro\_Cristovao](#):
>
> e rotation gizmo appears in the first canvas instead of the second.

This is extremely weird and looks like a bug to me do you have one GizmoManager per scene and could you share a repro ???

---

<div class="post-metadata">

**Author:** ![Pedro\_Cristovao](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pedro_cristovao/32/2172_2.png) [@Pedro\_Cristovao](https://forum.babylonjs.com/u/Pedro_Cristovao)\
**Post date:** [October 16, 2019, 2:01pm UTC](https://forum.babylonjs.com/t/how-to-add-a-utilitylayer-on-the-gizmomanager/6403/8 "2019-10-16T14:01:30Z")

</div>

> [@sebavan](#):
>
> ely weird and looks like a bug to me do you have one GizmoManager per scene and could you share a repro ???

It might be a bug, I think is hard to reproduce in a playground, maybe on a codesandbox, but it will take a while, not sure to have enough time.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [October 16, 2019, 2:04pm UTC](https://forum.babylonjs.com/t/how-to-add-a-utilitylayer-on-the-gizmomanager/6403/9 "2019-10-16T14:04:05Z")

</div>

A github link to your project ???

---

<div class="post-metadata">

**Author:** ![Pedro\_Cristovao](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pedro_cristovao/32/2172_2.png) [@Pedro\_Cristovao](https://forum.babylonjs.com/u/Pedro_Cristovao)\
**Post date:** [October 16, 2019, 2:14pm UTC](https://forum.babylonjs.com/t/how-to-add-a-utilitylayer-on-the-gizmomanager/6403/10 "2019-10-16T14:14:42Z")

</div>

> [@sebavan](#):
>
> project

It’s a private repo, don’t have the permissions to share.

I think to replicate one needs two add two canvas with two different scenes.

In each scene add a Sphere with a gizmoManager (different spheres and gizmos for each scene).

On a sphere click, attach the correspondent gizmo.

Check that the gizmos only appears in one of the canvas.

Thank you
