I’ve seen this example with the old Model and Animation component. I will use Mixamo for animations because they allow them to stay in place so using the Anim component won’t be a problem.
The only problem is using the Render component. When you load the glb with this.app.assets.loadFromUrl(cacheUrl, "model", function)
, you can use the model for the old Model component but not a Render component. I do realize you can only use the Render component with a render asset. How can I achieve that?
Hi @Syzyjeez!
I’m not exactly sure what your question is, but maybe the topic below can help you.
Can’t you just change model
with render
?
The Model componenet allows the model asset to be used which we are loading. I want to use the Render component instead which only allows render assets but I don’t know how to get one by loading a glb from a url.
I tried it, but it does not work. It just doesn’t finish loading and the callback isn called. I think that the model asset already has materials and maybe textures built into it while the render asset does not.
I found a solution, it turns out I had to import it as a GLB Container using the example’s utils functions and use asset.resource.instantiateRenderEntity
to create an entity with the render component with the imported model.