Background Loading Packed Scenes without Lag

Godot Version



I’m looking for a way to load new scenes in the background while leaving the main thread undisturbed. I’ve been trying to use the load_threaded_request() function of the built-in ResourceLoader class, as well as calling load() in a separate thread, but neither option seems to actually do what background loading is supposed to accomplish. I consistently get at least half a second of lag when loading any scenes with content in them.

I have tested this with very basic scenes (basically just a low-res tilemap, some UI and an audio player), and unsuccessfully tried to remove individual nodes from said scenes to identify potential bottlenecks, so this doesn’t seem to be a project-specific issue.

Is there any way to reduce the lack caused by loading PackedScene resources in another thread? Any tips and tricks that aren’t mentioned in the documentation?

Without any code or project files it’s impossible to tell what is wrong.

This is why you didn’t get any response on Reddit.

I have specified the functions I used and that this happens for various simple scenes regardless of the specific content. I don’t see what more relevant details I could provide tbh. I’m trying to find a solution for what seems like a general problem, not for one unique case.

Having the same issue, can’t seem to find any work around or fix for this yet…