# Mesh importing bug

**URL:** <https://forum.babylonjs.com/t/mesh-importing-bug/25687>\
**Category:** Bugs\
**Created:** [December 1, 2021, 5:49pm UTC](https://forum.babylonjs.com/t/mesh-importing-bug/25687 "2021-12-01T17:49:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![artteq](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@artteq](https://forum.babylonjs.com/u/artteq)\
**Post date:** [December 1, 2021, 5:49pm UTC](https://forum.babylonjs.com/t/mesh-importing-bug/25687/1 "2021-12-01T17:49:26Z")

</div>

Hi guys,

hope you’re well. Presumably I’ve found a bug with importing meshes.

After I import a mesh with BABYLON.SceneLoader.ImportMesh, it becomes impossible to turn the imported meshes off, i.e. setEnabled them false or make them mesh.isVisible = false.

I don’t know if this is an intended behaviour.

Please check the playground:  
[https://playground.babylonjs.com/#4F33I3#398](https://playground.babylonjs.com/#4F33I3#398)

Thank you!

---

<div class="post-metadata">

**Author:** ![Blake](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/blake/32/21509_2.png) [@Blake](https://forum.babylonjs.com/u/Blake)\
**Post date:** [December 1, 2021, 6:39pm UTC](https://forum.babylonjs.com/t/mesh-importing-bug/25687/2 "2021-12-01T18:39:44Z")

</div>

Hey there, I think the issue is that you aren’t using the onSuccess callback to wait for the meshes to be loaded before trying to use them. Here I used this callback to disable the new meshes as soon as they’re done loading. 🙂  
[https://playground.babylonjs.com/#4F33I3#400](https://playground.babylonjs.com/#4F33I3#401)

---

<div class="post-metadata">

**Author:** ![artteq](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@artteq](https://forum.babylonjs.com/u/artteq)\
**Post date:** [December 1, 2021, 7:10pm UTC](https://forum.babylonjs.com/t/mesh-importing-bug/25687/3 "2021-12-01T19:10:19Z")

</div>

Yeah, that’ve helped! Thank you!

I’ve tried to use the callback as well, only that I’ve used not the newMeshes variable but another name for it and this didn’t work in that case.

---

<div class="post-metadata">

**Author:** ![Blake](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/blake/32/21509_2.png) [@Blake](https://forum.babylonjs.com/u/Blake)\
**Post date:** [December 1, 2021, 7:29pm UTC](https://forum.babylonjs.com/t/mesh-importing-bug/25687/4 "2021-12-01T19:29:39Z")

</div>

Hmm, you should be able to use whatever names you want for the params to your onSuccess function. IDK what would be wrong with it, but if you can make another PG where it’s not working we can get it sorted out, if you’re still having an issue with it. 🙂 🍻
