How to check if scene asset streaming has ended?

Hi everyone!

I was wondering if there was any way, when loading a scene, to receive an event of some sort when the streaming of all the assets referenced in the scene has finished?

Currently, when calling loadScene(), I can see the content of the scene but for a few seconds I also see many assets “poping” in the scene. I would like to be able to wait until all these assets are fully loaded before displaying the scene itself.

Is there any way to do this?

Thanks in advance!

Hi @MathieuChillon and welcome,

Sadly there isn’t a way to automatically find out which assets are being used by the entity hierarchy of the scene currently loading. There is a single list of assets that is related to the whole project.

You will have to track down the assets required by a certain scene yourself. Common ways are by using tags, though agreed that involves manual labor.

If you have that list you can wait for all the assets to load and when that is done, fire a custom event of yours.

Thank you for your reply!

I understand what you suggest. Most assets in my game are only used in one scene so I will be able to tag them accordingly and check if they are loaded or not.

I will come back if I need more help but I think I will manage from here on!

Thanks again !

1 Like