Load model from URL

 this.app.assets.loadFromUrl("https://www.vrnewg.com/wth/my_model/xx.glb", "container", function (err, asset) 
    {   
        entity = asset.resource.instantiateRenderEntity();
        selfself.entity.addChild(entity);
        entity.setLocalPosition(0, 0, 0);
        entity.setLocalScale(0.01,0.01,0.01);
        var models = entity.findComponents("render");
        for(var i = 0;i<models.length;i++)
        {
            if(models[i].entity.name=="QSFLTQSXX_Model_0")
            {
                console.log(i);
                selfself.loadMaterial(models[i].entity);
            }
        }
    });

asset.resource.instantiateRenderEntity();
Uncaught TypeError: Cannot read properties of undefined (reading ‘instantiateRenderEntity’)
It worked a few months ago, but now it doesn’t

Hi @gyk,

Your code is correct but your remote url isn’t CORS enabled:

image

You will have to update your server to serve files with CORS headers to load them from another domain (playcanvas.com).

Thank you,You are right