I’m trying to port some of the code from this example over to an actual project: https://playcanvas.github.io/#/animation/locomotion
Specifically, I’m trying to use the AssetListLoader code to load a GLB model and some animations. In the example the urls for the various assets are static urls. I’m unsure how to correctly get the urls for my assets.
So in the example there is:
model: new pc.Asset("model", "container", {
url: "/static/assets/models/bitmoji.glb",
}),
idleAnim: new pc.Asset("idleAnim", "container", {
url: "/static/assets/animations/bitmoji/idle.glb",
}),
But I’m trying this:
model: new pc.Asset("model", "container", {
url: this.app.assets.find('RPM_Avatar_Steve_01.glb').getFileUrl(),
}),
idleAnim: new pc.Asset("idleAnim", "container", {
url: this.app.assets.find('talkingAnim.glb').getFileUrl(),
}),
But then I get this error:
Uncaught TypeError: Cannot read properties of undefined (reading ‘instantiateRenderEntity’)
So clearly this is not working as intended. What is the correct method here?