I have a Main node that receives a signal from a button when pressed, and triggers the function _on_do_things_button_pressed (all local, no network calls involved).
Stepping through the code with the debugger, I see that the string “String one” is correctly set (the label content property changes) but the displayed value doesn’t. When it reaches the point where it sets the “String two”, in this case the string is correctly displayed.
Why isn’t displaying the “String one” value?
Thanks for your help.
Yes, that’s the problem. I was in a hurry so I also asked in the discord and a user guided me to the resolution, that involved adding two await get_tree().process_frame after the label.text = "String one" assignment.
The same user also suggested to use threads, but I didn’t dived deeper.
By the way, can you point to some relevant documentation/resource to better understand the handling of the frames that Godot does?
I’m not sure if there’s something in the documentation specifically explaining that. You could check the Getting Started section in the documentation where it may give you more info about that.