How to handle when the scene loading fails?

Hi all,

Does anyone know if there any recommended approach for handling scenarios when the scene loading fails? Further to this, how do we know if one or more assets fail to load? In summary, what we are facing is we have a simple dashboard page in ReactJS where we have links (buttons) to our arcade games built-in PC but when we hit them to open any game sometimes the game won’t load at all (for example gets stuck at 10% of the loader bar). In such cases we see similar screens to the below where the user has to reload the page for it to work:

It can happen if you have the game open in the browser, then you do other things in other tabs/windows, then you go back and try to play.

Thanks in advance!

Any errors in the console? Is there a good way to reproduce this?

Yes, there is an error. This comes as “error while loading scene” in the console. It happens for us when the game is loading and then you do other things in other tabs and come back to try and play (this occurs sometimes).

That sounds like an issue with Ammo library not being loaded rather than a scene loading issue.

If it only happens sometimes, it could be a race/sync issue where the Ammo library is being loaded in time before the scene gets loaded.

I’m not sure how this project is setup or if there has been any modification on the loading/start scripts of the projects but if they have been modified, ensure that the Ammo library is loaded prior to the app being started/scene gets loaded.

Yes, it looks like that ammo library is failing to load sometimes here is the recent console

Does this happen outside your react JS app? (eg with a published build link)

Yes, It is happening with published build link

I’ve added this to my todo list and hopefully have a chance to look later this week. I would need to be able to reproduce this somehow reliably.

What would you say is the best method?

Looking at this now, I can’t see how the scene can load before the modules are loaded looking at __modules__.js and __start__.js files.

Can you DM me a link to your published link please to see if I can repro it on that?