Hello, I am creating a for loop, that I wish to stop once a given statement is found true. How would I go about doing this?
example:
for(var i in objectArray){
if(i.transform.position.y <= 0){
doSomething = true;
**stop the loop**;
}
else{doSomething = false;}
}
This above code is simili code, just to give an example. In my code, I have many if statements that can override each other, thus I need to stop the loop once a statement is validated.