Create instance doesn't work sometimes

Hello… I have several gltf meshes that I load from blob urls and then store in a variable and use later to create several instances of each asset in an absolute position at a defined scale. But for one particular asset it seems sometimes when I load even after loading it in the assets does not appear on the scene. This is not consistent as it re-appears on reloading the browser… Please help…

const plugin = BABYLON.SceneLoader.ImportMesh(
            (reason) => {
                // TODO sceneError({ name: fileName }, null, reason.message || reason);

        const self = this

        plugin.onMeshLoaded = function (mesh) {
            if ( !== '__root__') {
                console.log(`loaded model: ${}`)
                // remove it from scene
                self._sceneMeshes.set(key, mesh)
                self.progress += 1
                if (self.progress === self.totalModels) {
                    console.log('Loading successful')

Here is how am creating the instances

const { instanceID, origin, size } = instance
        const { _sceneMeshes } = this
        const mesh = _sceneMeshes.get(modelType)
        if (mesh) {
            const asset = mesh.createInstance(instanceID)
            asset.checkCollisions = true
            const modelSize = asset

            const position = new BABYLON.Vector3(
                -origin.x - size.width,

            const scale = new BABYLON.Vector3(
                size.width / modelSize.x,
                size.height / modelSize.y,
                size.depth / modelSize.z
            asset.scaling = scale
        } else {
            console.error(`could not find: ${modelType}`)

I have no errors in the console…

We would need a repro in the pg to help

Some doc about loading external assets:

sure let me try that… I’ll post the link here when done…

@Deltakosh it is not easy reproducing my specific architecture at the playground… If anyone is willing to offer paid support for an hour session it’d be better than spending hours to reproduce my exact architecture at the playground then I can organise a debug session.

That’s a good ask for our Paid services section :slight_smile:

sorry… where is that? :face_with_hand_over_mouth:

It’s the last entry of the category list:

1 Like