-
Notifications
You must be signed in to change notification settings - Fork 46
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
Waiting for a coroutine in a coroutine takes 1-Tick for the process to return #18
Comments
Remarks: WhenAll, WhenAny, etc. were registered and processed after the internal coroutine, so they behaved as intended. |
This behavior is by design and documented. Latent coroutines are fundamentally owned and controlled by the latent action manager and can only complete when it processes them on its own tick. This matches BP and most existing In some situations that I encountered, I managed to skip the extra tick by |
Thank you for your response,
If you don't mind, I would appreciate it if you could tell me what exactly you did in response. |
@aziogroup Instead of TCoroutine<> Fn1();
TCoroutine<> Fn2()
{
DoStuff();
co_await Fn1();
} it's TCoroutine<> Fn1();
TCoroutine<> Fn2()
{
DoStuff();
return Fn1();
} |
Thank you very much! |
Hello, I'm currently using UE5Coro to perform various tests.
When I call a coroutine from within another coroutine and wait for it, I've noticed that there's a 1-Tick delay before the internal coroutine finishes and the external coroutine resumes processing.
It turns out that I can avoid this delay by using
co_await WhenAny(TCoroutine<>)
instead of a simpleco_await TCoroutine<>
.Is this behavior intentional?
If it is intentional, is there a way to achieve the same behavior as WhenAny without using WhenAny when simply using co_await TCoroutine<>?
Thank you.
Result
The text was updated successfully, but these errors were encountered: