# Attach mesh to a glb/gltf skeleton bone

**URL:** <https://forum.babylonjs.com/t/attach-mesh-to-a-glb-gltf-skeleton-bone/55186>\
**Category:** Questions\
**Created:** [December 5, 2024, 2:53am UTC](https://forum.babylonjs.com/t/attach-mesh-to-a-glb-gltf-skeleton-bone/55186 "2024-12-05T02:53:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![satguru](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@satguru](https://forum.babylonjs.com/u/satguru)\
**Post date:** [December 5, 2024, 2:53am UTC](https://forum.babylonjs.com/t/attach-mesh-to-a-glb-gltf-skeleton-bone/55186/1 "2024-12-05T02:53:05Z")

</div>

Trying to attach a mesh to a bone as per instructions here

[https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons/#attaching-a-mesh-to-a-specific-bone](https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons/#attaching-a-mesh-to-a-specific-bone)

This works for a non glb/gltf skeleton like here

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

But not for a glb skeleton  
see

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

The location of mesh seems off. I thought setting it zero would help but it doesn’t.

Does glb/gltf require special handling ?

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [December 5, 2024, 9:13am UTC](https://forum.babylonjs.com/t/attach-mesh-to-a-glb-gltf-skeleton-bone/55186/2 "2024-12-05T09:13:00Z")

</div>

I believe the associated transform for a bone is found using:

```auto
sphere.attachToBone(skeleton.bones[0], skeleton.bones[0].getTransformNode());

```

But for some reason, there is an offset between the bone and the sphere. cc @Evgeni_Popov

---

<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:** [December 5, 2024, 1:56pm UTC](https://forum.babylonjs.com/t/attach-mesh-to-a-glb-gltf-skeleton-bone/55186/4 "2024-12-05T13:56:48Z")

</div>

I’m not sure `attachToBone` is appropriate for glb meshes. At least, I wasn’t able to make it work… It’s a lot easier to simply parent the mesh to the transformed node linked to the bone:

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

---

<div class="post-metadata">

**Author:** ![satguru](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@satguru](https://forum.babylonjs.com/u/satguru)\
**Post date:** [December 5, 2024, 11:13pm UTC](https://forum.babylonjs.com/t/attach-mesh-to-a-glb-gltf-skeleton-bone/55186/5 "2024-12-05T23:13:32Z")

</div>

Nice. Thanks  
Might be a good idea to update the document for GLTF/GLB meshes
