Custom loading for ImportMesh

Hello to everyone.

I have to call Importmesh more than once. I want to show a custom loading on the screen until all mesh is loaded. If you look at this code, you can see that there is a mistake. It works only for the first importmesh. If you look carefully, the loading screen remains on the stage until the first skull is loaded. It disappears without waiting for the others. But I want him to wait for it all. How can I make a loading on the screen until all the mesh in the scene is loaded?

https://www.babylonjs-playground.com/#JUKXQD#136

Hi!
Is it your intention to create multiple instances of the same mesh or to load different meshes later?

Exactly.

I have to add different mesh to the scene according to the user’s choices. I have a lot of gltf.

I hope that this can help you:
https://www.babylonjs-playground.com/#JUKXQD#139

I tried to modify your example with the assetsManger and maybe this is something for you!

1 Like

I find it easier to do this with promises, but AssetsManager also works.

https://www.babylonjs-playground.com/#JUKXQD#140

1 Like