# Replace of submesh

**URL:** <https://forum.babylonjs.com/t/replace-of-submesh/20655>\
**Category:** Questions\
**Created:** [May 7, 2021, 5:28pm UTC](https://forum.babylonjs.com/t/replace-of-submesh/20655 "2021-05-07T17:28:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![inevitable](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/inevitable/32/13478_2.png) [@inevitable](https://forum.babylonjs.com/u/inevitable)\
**Post date:** [May 7, 2021, 5:28pm UTC](https://forum.babylonjs.com/t/replace-of-submesh/20655/1 "2021-05-07T17:28:11Z")

</div>

Hi Guys,

I am playing around the 3D model customisization. Like changing the hairstyle. I see the hairstyle is the part of 3d model which need to be replaced with new one. I have no idea how to approach this.

Please suggest.

---

<div class="post-metadata">

**Author:** ![PirateJC](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/piratejc/32/1003_2.png) [@PirateJC](https://forum.babylonjs.com/u/PirateJC)\
**Post date:** [May 7, 2021, 6:01pm UTC](https://forum.babylonjs.com/t/replace-of-submesh/20655/2 "2021-05-07T18:01:22Z")

</div>

Hey @inevitable! Fun question.

If I were tackling this problem, I’d have a model of a character without hair. Then I’d have separate models for each hair style. Then I’d load the models in Babylon as needed (on user interaction as an example). Then the final step would be to parent the hair to the character’s head.

Note that depending on where (in 3D space) the hair geometry is actually located when you create it, you MAY have to take positional offsets into consideration.

Hope this is helpful!

---

<div class="post-metadata">

**Author:** ![inevitable](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/inevitable/32/13478_2.png) [@inevitable](https://forum.babylonjs.com/u/inevitable)\
**Post date:** [May 9, 2021, 6:54am UTC](https://forum.babylonjs.com/t/replace-of-submesh/20655/3 "2021-05-09T06:54:49Z")

</div>

Hey @PirateJC Thanks for the replay. I tried with changing the applying meshes[0].parent = parent\_node it is not properly appended mesh to head.

see below image.

 ![screenshot_21-5-9_12-04](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/d/5/d55cd2a6906e6351df73da2537403b969633d7ff.png)

---

<div class="post-metadata">

**Author:** ![PirateJC](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/piratejc/32/1003_2.png) [@PirateJC](https://forum.babylonjs.com/u/PirateJC)\
**Post date:** [May 10, 2021, 3:31pm UTC](https://forum.babylonjs.com/t/replace-of-submesh/20655/4 "2021-05-10T15:31:22Z")

</div>

This is likely due to the pivots and offsets of the character’s head and hair.

If you’d like to post a playground example with both assets in it, I’d be happy to help take a closer look!

---

<div class="post-metadata">

**Author:** ![inevitable](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/inevitable/32/13478_2.png) [@inevitable](https://forum.babylonjs.com/u/inevitable)\
**Post date:** [May 11, 2021, 4:29pm UTC](https://forum.babylonjs.com/t/replace-of-submesh/20655/5 "2021-05-11T16:29:46Z")

</div>

Sure i will update playground.
