# Skeleton Misaligned with Mesh After Import

**URL:** <https://forum.babylonjs.com/t/skeleton-misaligned-with-mesh-after-import/52673>\
**Category:** Bugs\
**Tags:** mesh, skeleton, import, sceneloader\
**Created:** [August 9, 2024, 4:13pm UTC](https://forum.babylonjs.com/t/skeleton-misaligned-with-mesh-after-import/52673 "2024-08-09T16:13:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![onekit](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/onekit/32/49527_2.png) [@onekit](https://forum.babylonjs.com/u/onekit)\
**Post date:** [August 9, 2024, 4:13pm UTC](https://forum.babylonjs.com/t/skeleton-misaligned-with-mesh-after-import/52673/1 "2024-08-09T16:13:19Z")

</div>

I researched the forum for my issue and saw similar problems, but I couldn’t apply other solutions to my situation. Similar issue:

> [@BUG: Mesh flips on mesh.skeleton = skeleton](https://forum.babylonjs.com/t/bug-mesh-flips-on-mesh-skeleton-skeleton/27403/1):
>
> Hey guys, I’m trying to apply a mesh with vertices onto a skeleton, but the mesh completely flips before I can do anything related to skinning. This line is the culprit catmesh.skeleton = skeleton // CAUSES MESH TO FLIP 90 DEGREES Here’s the [PG](https://playground.babylonjs.com/#SYQW69#955) [image]

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/f/6/f63276ea4a93d2b682229070aef9a1b14084eeb6.png)  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/e/f/ef366cc35ab77adbd4f0ff28a9e28e0ea76875e5.png)

Here’s the problem I’m facing. I suspected that the issue might be with the GLB model itself, but when I load it in the glTF Viewer, the skeleton is inside the mesh, and everything is fine.

It’s very important to me that both the mesh and the skeleton work correctly immediately upon loading by `SceneLoader`. 🥹

```auto
const importedMeshes = await SceneLoader.ImportMeshAsync('', meshTask.rootUrl, meshTask.sceneFilename)

```

When trying to place an item in the character’s hand, it turned out that the skeleton loads not inside the mesh, but is rotated and scaled up. Then I highlighted the skeleton using the SkeletonViewer, and it became clear what the problem was.

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

If you’re a passing Jedi and have had a similar problem, please help with positioning the skeleton and synchronizing it with the mesh.

---

<div class="post-metadata">

**Author:** ![regna](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/regna/32/23915_2.png) [@regna](https://forum.babylonjs.com/u/regna)\
**Post date:** [August 9, 2024, 5:41pm UTC](https://forum.babylonjs.com/t/skeleton-misaligned-with-mesh-after-import/52673/2 "2024-08-09T17:41:55Z")

</div>

@onekit I imported your `player.glb` into Blender, scaled the skeleton up by 20X, and exported the new `player.glb` into the Playground below:

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

Here’s a video of the changes I made in Blender. To summarize, the skeleton had a 0.05 scale instead of 1. So I just scaled the skeleton up by 20X and “Apply All Transforms” in Blender:

[![](https://img.youtube.com/vi/K_IzLDMh_aU/hqdefault.jpg "blender player") ](https://www.youtube.com/watch?v=K_IzLDMh_aU)

I also scaled the mesh down by 20X to give the original size as your first Playground:

```ts
meshes[0].scaling.multiplyInPlace(new BABYLON.Vector3(0.05, 0.05, 0.05))

```

---

<div class="post-metadata">

**Author:** ![onekit](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/onekit/32/49527_2.png) [@onekit](https://forum.babylonjs.com/u/onekit)\
**Post date:** [August 9, 2024, 10:17pm UTC](https://forum.babylonjs.com/t/skeleton-misaligned-with-mesh-after-import/52673/3 "2024-08-09T22:17:51Z")

</div>

Dear regna,

Thank you for guiding me onto the right path. I was stuck on my pet project for half a month because of this issue, and now you’ve saved me. It looks fixed now. 😃

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/f/9/f978e03f9084ea673b255488e25577f43281a9f2.jpeg)

May the Force be with you. You even took the time to record a video explanation.  
Thank you so much. 🤝

When the beta version of the game is ready, I’ll definitely show you my hobby project, which you’ll be able to play. 🤗

---

<div class="post-metadata">

**Author:** ![regna](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/regna/32/23915_2.png) [@regna](https://forum.babylonjs.com/u/regna)\
**Post date:** [August 9, 2024, 11:59pm UTC](https://forum.babylonjs.com/t/skeleton-misaligned-with-mesh-after-import/52673/4 "2024-08-09T23:59:03Z")

</div>

I’m happy to be able to help 🙂 Your game looks amazing, and I’m excited to play when ready!
