# Attaching Gizmo to TransformNode. Instead attaches gizmo to root mesh

**URL:** <https://forum.babylonjs.com/t/attaching-gizmo-to-transformnode-instead-attaches-gizmo-to-root-mesh/30570>\
**Category:** Questions\
**Created:** [May 20, 2022, 12:33pm UTC](https://forum.babylonjs.com/t/attaching-gizmo-to-transformnode-instead-attaches-gizmo-to-root-mesh/30570 "2022-05-20T12:33:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![omerization](https://avatars.discourse-cdn.com/v4/letter/o/a587f6/32.png) [@omerization](https://forum.babylonjs.com/u/omerization)\
**Post date:** [May 20, 2022, 12:33pm UTC](https://forum.babylonjs.com/t/attaching-gizmo-to-transformnode-instead-attaches-gizmo-to-root-mesh/30570/1 "2022-05-20T12:33:24Z")

</div>

Hello,

I am trying to add gizmo to TransformNode. But I couldnt do it despite I tried many things.  
When I click on Node, pickresult is correct but gizmo always added to **root** mesh and position is always same even pickresult changes.

Please help mee!

```auto
    let gizmoManager = new BABYLON.GizmoManager(scene);

    gizmoManager.positionGizmoEnabled = true;
    gizmoManager.rotationGizmoEnabled = true;
    gizmoManager.usePointerToAttachGizmos = true;

    scene.onPointerDown = function addGizmoOnMeshClick() {
        gizmoManager.attachableNodes = scene.transformNodes;

        const pickResult = scene.pick(scene.pointerX, scene.pointerY);
        console.log(scene.meshes);

        if (pickResult.hit) {
            console.log(pickResult.pickedMesh.parent);

            gizmoManager.attachToNode(pickResult.pickedMesh.parent);
            console.log(gizmoManager);
        } else {
            gizmoManager.attachToMesh(null);
        }

    }

```

---

<div class="post-metadata">

**Author:** ![omerization](https://avatars.discourse-cdn.com/v4/letter/o/a587f6/32.png) [@omerization](https://forum.babylonjs.com/u/omerization)\
**Post date:** [May 20, 2022, 12:37pm UTC](https://forum.babylonjs.com/t/attaching-gizmo-to-transformnode-instead-attaches-gizmo-to-root-mesh/30570/2 "2022-05-20T12:37:24Z")

</div>

I realized it is also not working with attachToMesh. Why it is attaching to **root**? ☹

---

<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:** [May 20, 2022, 8:17pm UTC](https://forum.babylonjs.com/t/attaching-gizmo-to-transformnode-instead-attaches-gizmo-to-root-mesh/30570/3 "2022-05-20T20:17:05Z")

</div>

Can you provide a repro in the playground ?

---

<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:** [May 20, 2022, 8:21pm UTC](https://forum.babylonjs.com/t/attaching-gizmo-to-transformnode-instead-attaches-gizmo-to-root-mesh/30570/4 "2022-05-20T20:21:02Z")

</div>

It seems to work here [https://playground.babylonjs.com/#31M2AP#299](https://playground.babylonjs.com/#31M2AP#299)

---

<div class="post-metadata">

**Author:** ![omerization](https://avatars.discourse-cdn.com/v4/letter/o/a587f6/32.png) [@omerization](https://forum.babylonjs.com/u/omerization)\
**Post date:** [May 21, 2022, 10:24am UTC](https://forum.babylonjs.com/t/attaching-gizmo-to-transformnode-instead-attaches-gizmo-to-root-mesh/30570/5 "2022-05-21T10:24:17Z")

</div>

@sebavan Thank you for your response. I created a playground. Link below:

> **[Babylon.js Playground](https://playground.babylonjs.com/#31M2AP%23300)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

It is still not working

---

<div class="post-metadata">

**Author:** ![omerization](https://avatars.discourse-cdn.com/v4/letter/o/a587f6/32.png) [@omerization](https://forum.babylonjs.com/u/omerization)\
**Post date:** [May 21, 2022, 2:04pm UTC](https://forum.babylonjs.com/t/attaching-gizmo-to-transformnode-instead-attaches-gizmo-to-root-mesh/30570/6 "2022-05-21T14:04:54Z")

</div>

Shortly, I converted this model from STEP to GLB. And I am trying to attach gizmo only to every part of assembly. And I guess they are transformnodes of scene.

---

<div class="post-metadata">

**Author:** ![omerization](https://avatars.discourse-cdn.com/v4/letter/o/a587f6/32.png) [@omerization](https://forum.babylonjs.com/u/omerization)\
**Post date:** [May 22, 2022, 11:59am UTC](https://forum.babylonjs.com/t/attaching-gizmo-to-transformnode-instead-attaches-gizmo-to-root-mesh/30570/7 "2022-05-22T11:59:17Z")

</div>

I don’t know why but when I used Gizmo instead of GizmoManager it worked.

---

<div class="post-metadata">

**Author:** ![Blake](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/blake/32/21509_2.png) [@Blake](https://forum.babylonjs.com/u/Blake)\
**Post date:** [May 22, 2022, 4:52pm UTC](https://forum.babylonjs.com/t/attaching-gizmo-to-transformnode-instead-attaches-gizmo-to-root-mesh/30570/8 "2022-05-22T16:52:52Z")

</div>

I suspect the GizmoManager’s own picking and attaching behavior was competing with yours… Because usePointerToAttachGizmos should be set to false since you’re doing that part yourself. Not sure if that was the only issue you were having with GizmoManager but prob part of it. 🙂
