Hi, I’m almost sure this is a scoping issue but when I try to use other ways I Playcanvas just hangs so I was wondering if I could get some clarity.
I need the the function load_model to call the function populate_mattress_data when its done loading. With this code below, it just says that populate_mattress_data is not a function…
ModelScreenManager.prototype.populate_mattress_data = function() {
console.log("now we display the model");
}
ModelScreenManager.prototype.load_model = function(model_to_load) {
var self = this;
var onAssetReady = function(asset) {
// Show the entity when the asset is loaded
console.log("NOW SHOW ASSET "+model_to_load.name);
this.populate_mattress_data();
};
// Start async loading the asset
model_to_load.ready(onAssetReady);
this.app.assets.load(model_to_load);
};