#Help with async scene loading

14 messages · Page 1 of 1 (latest)

zenith path
#

Does anyone have worked with async scene loading? I have a script to do so and it works fine for [from main menu -> game] but doesnt work for [from game -> main menu]. Idk why, maybe due to that the game is paused when im trying to load a scene (iv set procces mode to "always" so it shouldnt be it). Looking for help. P.S. debugger returns that it sees the scene im trying to load but never loads it, moreover the game is not frozen and i can close pause menu to continue playing (scene doesnt load anyway)

left scaffold
zenith path
zenith path
#

yeah, stupid me xd

left scaffold
# zenith path yeah, stupid me xd

one suggestion i might have is to use await get_tree().process_frame instead of creating a timer with such a low time. probably not a big difference, but should be a bit cleaner.

zenith path
pearl sequoia
#

another way is to just check the status in _process with no loop or timers

#

you really almost never want to do a loop that waits on something to happen in godot, because the loop blocks the engine from being able to process that other thing at all (even if the loading happens in another thread, it might still need to do things in the main thread, so it must not be blocked with a loop)

left scaffold
pearl sequoia
#

right

zenith path
left scaffold
# zenith path

if you're already adding an error check for load_threaded_get_status() you could also add one for load_threaded_request()