# Merging Meshes after adding pin to a 3d model

**URL:** <https://forum.babylonjs.com/t/merging-meshes-after-adding-pin-to-a-3d-model/29659>\
**Category:** Questions\
**Created:** [April 24, 2022, 7:52pm UTC](https://forum.babylonjs.com/t/merging-meshes-after-adding-pin-to-a-3d-model/29659 "2022-04-24T19:52:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bleakGorilla](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bleakgorilla/32/23261_2.png) [@bleakGorilla](https://forum.babylonjs.com/u/bleakGorilla)\
**Post date:** [April 24, 2022, 7:52pm UTC](https://forum.babylonjs.com/t/merging-meshes-after-adding-pin-to-a-3d-model/29659/1 "2022-04-24T19:52:25Z")

</div>

Hello everyone! I’m trying to add pins by double clicking on a point in the mesh (a triceratops skull in the playground). I wish to merge the pin mesh (a simple combination of sphere and cube) and the skull mesh and reuse the skull mesh to merge pins that are further added to it every double click event. I’m using the MergeMeshes function but it is currently returning a null value to me all the time and I’m unable to merge them together. The pins are added to the scene correctly. I’m trying to merge the meshes so that the overall model can be rotated and scaled later on.

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

---

<div class="post-metadata">

**Author:** ![bleakGorilla](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bleakgorilla/32/23261_2.png) [@bleakGorilla](https://forum.babylonjs.com/u/bleakGorilla)\
**Post date:** [April 24, 2022, 10:31pm UTC](https://forum.babylonjs.com/t/merging-meshes-after-adding-pin-to-a-3d-model/29659/2 "2022-04-24T22:31:55Z")

</div>

To better demonstrate what I’m trying to achieve:

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

Whenever a new pin is added, it should attach/merge itself with the skull mesh and rotate along with it.

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [April 25, 2022, 3:04pm UTC](https://forum.babylonjs.com/t/merging-meshes-after-adding-pin-to-a-3d-model/29659/3 "2022-04-25T15:04:24Z")

</div>

Hello!  
You don’t need to merge the meshes if you just want to apply the same rotation, you can parent both to a TransformNode and rotate that node instead 🙂

Also, if you plan to add lots of pins and performance is a concern, you can use Instances [Instances | Babylon.js Documentation (babylonjs.com)](https://doc.babylonjs.com/divingDeeper/mesh/copies/instances)
