How does one tell a function to wait until a boolean becomes true?
quick example of situation
function attackOne(){
run = true; walk = false; LookAtFoe = true;
// some how tell this function to wait and continue until bool is true?
if(inDistanceFoe){
animation.Crossfade("Punch");
FoeHealth -=20;
}
run = false;
StartCoroutine("backUp");
StopCoroutine("attackOne");
}
Thank you