Hi, I have a problem with dynamic model changing. Materials aren’t changing when model set up through scene. So, if i want to dynamically change model during game, I need to leave model on scene empty. Cause otherwise materials will not change.
Demo scenes:
Materials are remains same on model change (the character model is set on scene).
Materials are changing on model change (model is empty on scene).
I’m changing model like this:
ModelChanger.prototype.swapMesh = function(modelName) {
var asset = this.app.assets.find(modelName);
if(asset !== undefined) {
var self = this;
asset.ready(function (asset) {
self.entity.model.model = asset.resource;
});
this.app.assets.load(asset);
}
else {
console.error("No model with name " + modelName + " was found");
return;
}
};
So is it me doing something wrong, or it’s some bug?