- Home /
Question by
Oninji · Jan 17, 2012 at 04:04 PM ·
javascriptbooleanyield
Yield WaitForTrue?
Greetings,
I'll make it short, is there a yield function that can make the function wait until a certain boolean is at true?
I have other solutions, but it'd be muuuch more cleaner if there would be such a thing.
PS: From the script reference, there isn't so I'm double checking.
Comment
Best Answer
Answer by Eric5h5 · Jan 17, 2012 at 04:17 PM
Just use yield, and check for the boolean.
function Wait () {
while (!someBoolean) {
yield;
}
}
Your answer
Follow this Question
Related Questions
Stuck while solving a Coroutine problem 0 Answers
Yield Waitforseconds not working at all 3 Answers
Why does it seem like my boolean is true and false 0 Answers