Search Unity

Question Coroutine with yield WaitUntil

Discussion in 'Scripting' started by pKallv, Jul 23, 2022.

  1. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,191
    What would be the best way of get this to time out if the WaitUntil condition is not met?
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    Using a while loop checking if the bool is false. Have a yield return null (or other) in it and have a timer in it to return the routine once a set time has passed
     
    pKallv likes this.
  3. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,191
    Tx that is how I did it finally.
     
    DevDunk likes this.