Loading progress on procedurally generated scene

Godot Version

4.22

Question

Is there any easy way to put something that moves on the screen when loading a procedurally generating scene? Some spinning object or anything? Loader is now practically just 0 or 100. The scene is heavy and took about +15s to load. And it is a bit long time to look still screen and think is it doing anything. Thanks!

You’ll need to generate the scene in a Thread. Here’s a small demo about using a Thread to load textures godot-demo-projects/loading/threads at master · godotengine/godot-demo-projects · GitHub

You could also use the WorkerThreadPool if you don’t want to manage the threads yourself.

Either way, you should check these documentation pages Using multiple threads — Godot Engine (stable) documentation in English and Thread-safe APIs — Godot Engine (stable) documentation in English to know how to use them correctly

I’ll look that. Thanks! You have knowledge on advande does this work on android? My current loader uses ResourceLoader.load_threaded_request. It works somehow on pc - there is more than 0 and 100, but on android it is only 0 and when loaded its 100.

I don’t know, sorry.

Code was so simple, so I tried this demo-project code. It kinda works; it loads the scene footage on the background, but when the scene footage (few kb) is loaded and it starts generate the scene, everything still freezes until scene is ready. So in this way it is at least possible to load everything in chunks. Might been possible without thread loader. But maybe the WorkerThreadPool could be some answer. It would still be great if there is some way to add movement on the screen easily when scene is loading/generating.