I am loading a .glb file as a container asset, with model and animation data. This works fine, but when I call app.destroy it starts logging a lot of errors
This happens when using engine-only as well as through the editor.
My code for loading GLB:
var LoadGlb = pc.createScript('loadGlb');
LoadGlb.attributes.add("glb", {type: "asset"});
LoadGlb.prototype.initialize = function() {
var app = this.app;
var blob = new Blob([new Uint8Array(this.glb.resource).buffer]);
var url = URL.createObjectURL(blob);
this.app.assets.loadFromUrlAndFilename(url, "model.glb", "container", function (err, asset) {
var entity = new pc.Entity("GLB Model");
entity.addComponent("model", {
type: "asset",
asset: asset.resource.model,
});
entity.addComponent("animation", {
assets: asset.resource.animations,
loop: true
});
app.root.addChild(entity);
setTimeout(function(){
app.destroy();
}, 2000);
});
};
Reproducable project: https://playcanvas.com/project/746692/overview/animation-destroy-app-bug
The glb loader is on the Root object. I’ve also imported an fbx version with mesh and animation, which does not cause the error (thats the disabled object in the hierarchy ‘cube_withanim’.