New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
await signal yields before its listeners get executed, if they were registered via anonymous function #75341
Comments
If I replace this code:
with this:
It starts working as expected
|
That happens due to how Godot handles connections. gscript_vm.cpp:2367 - VM So await returns before lambda functions have chance to execute. Hope, it helps @Calinou |
If maintaining insertion order is cumbersome, I would just allow So, this:
Will become this:
|
Actually, insertion order is not a fix. You always want |
@Calinou I want to PR, could we discuss how it should be implemented? I wanted to add new slot_map, but there are lots of things going on around slot_map. Adding
Adding new The only thing I understand - await-resume functions should always be executed last. There should be either separate vector for them or way to sort them last. |
Godot version
v4.0.1.stable.official [cacf499]
System information
Mac OS 13.0.1
Issue description
Following tutortial https://docs.godotengine.org/en/stable/getting_started/first_2d_game/06.heads_up_display.html
Wanted to connect signal via code instead of editor. But it breaks the logic - signal callback is triggered after
await Timer.timeout
"Dodge the\nCreeps!" doesn't appear on the screen
Steps to reproduce
Console output:
Minimal reproduction project
Dodge_the_Creeps.zip
The text was updated successfully, but these errors were encountered: