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)
#Help with async scene loading
14 messages · Page 1 of 1 (latest)
well, did you test if it works without pausing?
Already solved. the pause wasnt the problem, the reason was that i didnt revert is_transitioning state to false, so after 1st scene load it was always in "loading" state
oh true
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.
OH, didnt now about it, will def use it, thanks a lot
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)
i mean that's why they are using await, but yeah i would also suggest avoiding awaits by restructuring it with the _process-function.
right
i could try it, thanks for suggestions !
if you're already adding an error check for load_threaded_get_status() you could also add one for load_threaded_request()