Hi all,
I have been using Playcanvas for a while an first of all congratulations, is probably the best WebGL engine I’ve found so far.
I’m using Playcanvas but just the plain engine, I don’t use the editor (only for exporting assets). Everything is good but I have an issue with the component loading. I add components in the following way:
entity.addComponent("script", {
scripts: [{
url: 'js/app/scripts/script1.js',
name: 'script1',
attributes: []
},{
url: 'js/app/scripts/script2.js',
name: 'script2',
attributes: []
}]
});
But I can’t really access the scripts until a few seconds later. If I do:
entity.script.script1
right after the component loading, script1 is undefined.
I guess the components loading is done in a async way. Is there any way I can know the components have been effectively loaded and I can start using them?.
Thanks for the great work.