engine icon indicating copy to clipboard operation
engine copied to clipboard

Asset.ready() event is called incorrectly when loading assets that are inside a container

Open OlegGedzjuns opened this issue 1 year ago • 2 comments

When loading a mesh asset inside a glb container .ready() callback on the mesh asset is called immediately, not waiting for the container asset to be loaded.

https://playcanvas.com/project/1242313/overview/incorrect-ready-on-loading launch, check the console for logs

  1. subscribe to mesh asset ready
  2. subscribe to container asset ready
  3. start loading mesh asset
  4. mesh ready callback is called immediately, .resource.meshes variable is null inside the mesh asset, but the asset is marked as loaded
  5. container asset is loaded
  6. container ready is called
  7. mesh asset now has meshes

mesh asset ready() should be called only when an actual container is loaded

OlegGedzjuns avatar Aug 06 '24 07:08 OlegGedzjuns

@slimbuck Is this something you're familiar with?

willeastcott avatar Aug 06 '24 14:08 willeastcott

Can confirm render assets fire ready immediately instead of waiting for container ready, but don't see an immediate simple fix.

slimbuck avatar Aug 08 '24 10:08 slimbuck