[SOLVED] Dynamic loading changes in 1.40?


Have you made any change regarding dynamic loading of assets in 1.40?
My project works in 1.39.4 but in 1.40 when I jump between scenes some assets are not loaded properly.

Here’s a build I can share:
To see the issue:
-click on the glass behind the hiking couple to jump to the nature scene
-press B on your keyboard to jump back to the main hub

In 1.39.4, everything loads fine.

Can you test against v1.40.2 please?

I think the change that may have affected this was https://github.com/playcanvas/engine/pull/3048 and that was added in 1.40.3

1 Like

If it is indeed related to the issue @yaustar posted above, you can temporarily solve for this by not unloading the materials between scenes. You can still unload the texture files, just not the materials see:

For more information.

1 Like

I confirm the same code works on 1.40.2. No issues whatsoever.

1 Like

I already deployed that project with 1.39 so I’m not in a rush. I was just doing some cleaning up and I noticed the issue. I’ll wait for the fix.

Pinging @ray - I will try it find some time tomorrow to create a repro (unless someone beats me to it :grimacing:)

Here is an example that shows the error. Go to Scene02 and then back to Scene01. See the console WebGL errors due to the material asset’s data texture references pointing to now destroyed Textures. To see a workaround uncomment line 21 of _dev.js ( link below )


The work around is when a material is unloaded, I reset the material asset’s data texture references back to the texture assets ID.

Thanks, added to the ticket: https://github.com/playcanvas/engine/issues/3061


I see that the bug was fixed in 1.40.5 that was just pushed. Thanks a lot!