Back to Writing
NOTESunitycoroutinewaituntilasynccsharp

Unity Coroutine — WaitUntil Guide

December 20, 2019Updated Feb 17, 2026

![](

H_uxh4ht6yrzQtCjnog.h4Fo_VSd3BLt3MGTgTIh7nq1OyLi8KHcMGcgrytz4Iwg.PNG.cdw0424/image.png?type=w966)

This is how you wait for an operation to complete within a coroutine. It functions similarly to an async callback.

public WaitUntil(Func<bool> predicate);

The parameter takes a Func that returns a bool type.

Because of this, the function passed to WaitUntil keeps looping until it returns true. Once it returns true, the coroutine proceeds past the yield.

Note:

In Func<T>, the last generic type parameter represents the return type.

For example, Func<int, bool> means the parameter is of type int and the return type is bool.


Unity - Scripting API: WaitUntil.WaitUntil


Unity - Scripting API: WaitUntil