This is my first post! Now that we got that out of the way, I had a question/problem regarding audio stuttering while loading another scene.
Currently I have a menu, that consists of a splash going into an autosave notice that goes into the real menu screen. Everytime I switch the scene the music cuts out for a second while it’s switching. Is there any way around this problem? I’d like my background music to continue while the menu seamlessly switches ‘scenes’.
This was posted by one of the Defold team @Andreas_Tadic :
Hi Gregor,
This is expected behaviour.
When factory dynamic loading is disabled, the resources contained (in the collection or go) are loaded with the parent collection.
When factory dynamic loading is enabled, you’re expected to call factory.load/unload as needed meaning you control when the resources are loaded and unloaded in memory. Load/unload are asynchronous calls.
If you call factory.create on a factory with dynamic loading enabled without having called load (not having the resources in memory) it will create the resources needed in the create call synchronously which is why you get the stutter.
If you want to go with dynamic loading, you should load like this in your init function: