# Difference between mesh.attachToBone & mesh.parent = BONE

**URL:** <https://forum.babylonjs.com/t/difference-between-mesh-attachtobone-mesh-parent-bone/11767>\
**Category:** Questions\
**Created:** [June 17, 2020, 11:31am UTC](https://forum.babylonjs.com/t/difference-between-mesh-attachtobone-mesh-parent-bone/11767 "2020-06-17T11:31:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![suredelta](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@suredelta](https://forum.babylonjs.com/u/suredelta)\
**Post date:** [June 17, 2020, 11:31am UTC](https://forum.babylonjs.com/t/difference-between-mesh-attachtobone-mesh-parent-bone/11767/1 "2020-06-17T11:31:03Z")

</div>

What’s the difference between mesh.attachToBone(BONE, MESH) & mesh.parent = BONE

---

<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:** [June 17, 2020, 1:25pm UTC](https://forum.babylonjs.com/t/difference-between-mesh-attachtobone-mesh-parent-bone/11767/2 "2020-06-17T13:25:51Z")

</div>

I would suggest to rely on attachToBone which internally does mesh.parent = BONE but also adds the extra steps to compute the proper scalingDeterminant, prepare the skeleton for the newly attached mesh:

```auto
/**
     * Attach the current TransformNode to another TransformNode associated with a bone
     * @param bone Bone affecting the TransformNode
     * @param affectedTransformNode TransformNode associated with the bone
     * @returns this object
     */
    public attachToBone(bone: Bone, affectedTransformNode: TransformNode): TransformNode {
        this._transformToBoneReferal = affectedTransformNode;
        this.parent = bone;

        bone.getSkeleton().prepare();

        if (bone.getWorldMatrix().determinant() < 0) {
            this.scalingDeterminant *= -1;
        }
        return this;
    }

```

---

<div class="post-metadata">

**Author:** ![suredelta](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@suredelta](https://forum.babylonjs.com/u/suredelta)\
**Post date:** [June 17, 2020, 1:30pm UTC](https://forum.babylonjs.com/t/difference-between-mesh-attachtobone-mesh-parent-bone/11767/3 "2020-06-17T13:30:23Z")

</div>

I was just curious if there was something “special” about how the parenting/attach works with this kind of case.
