Cannot disable creating instances on the sceneloader

Hi, Until recently I could disable instance creation by setting the createInstances to false on the SceneLoader object. e.g.,

var loader = BABYLON.SceneLoader.ImportMesh(“”, “test.gltf”, “”, scene, function (meshes) {

});
loader.createInstances = false;

This does not seem to work anymore. Can someone help understand what has changed around this?

This has changed:
Potential new breaking change - Please chime in! - Breaking Changes - Babylon.js

To fix your issue:

BABYLON.SceneLoader.OnPluginActivatedObservable.add(loader => {
    loader.createInstances = false;
});
BABYLON.SceneLoader.ImportMesh(“”, “test.gltf”, “”, scene, function (meshes) {

});
1 Like

@Deltakosh thank you so much, it works now :smiley:

1 Like