Decrease Loading Time

Hi guys,

I couldn’t find anywhere in playcanvas documentation about optimizing loading time. I am quite a beginner so could anyone explain which factors would affect loading time in playcanvas please?
Would playcanvas load all my asset during loading time, or can I not load the assets by setting entity.enabled = false, then load it after during the game, would that reduce loading time?
Or if I have a variety of sounds that do not play right away, but only at certain time during the game, can I disable the sound then enable it during the game, would that reduce the loading time?

Thank you!

Hi @dongqtm,

Your best friend here is the preload flag, found in the inspector panel when you select any asset.

If it’s selected then this asset will be loaded during the initial load time.

If not, the asset will be loaded as soon as it’s requested by any entity component in your scene.

So a good strategy is to use this flag to load only the absolute minimum of assets required to run your app. And load the rest gradually.

After that, try to optimize the downloadable size of your asset, use JPG instead of PNG whenever you can for your images, reduce their resolution, optimize your models if they are unnecessary heavy. Use mp3 instead of wav files for your music.

1 Like

Optimizing loading time is something on my to-do list to add to the user manual.

1 Like

Well, I’ve been referring to this guide for optimization.

Also, preload guid helps.

1 Like

Ah There’s already a page :sweat_smile: That page needs improvement.

Thank you so much guys for all these tips! I will try these out for sure!