How can I achieve this in C#. I need to wait until the parent node has finished his initialization.
yield(owner, "ready")
How can I achieve this in C#. I need to wait until the parent node has finished his initialization.
yield(owner, "ready")
Instead of yield
ing, connect the ready
signal from parent to child
Thanks will try it that way.
Do you know is it generally possible to "await" things with C# in Godot? So using Task, IEnumarators and async operations?
Or better yet:
await ToSignal(Owner, SignalName.Ready);
By using SignalName
you avoid having to use string literals.
And Owner
might be better than parent, depending on what's happening in your code.
Also, don't forget that the method this line is in will have to be set as async
in order to use await
.
© 2022 - 2024 — McMap. All rights reserved.