0
Q:

How can I do a foreach loop for an array of booleans

 // The problem is not that your array is boolean,
 // it is that you are trying to assign value to buttonBoolean in foreach loop. It is read-only as every foreach iteration variable is
 
 // You could do this instead:
 
 public bool[] inputBool;
      
     for(int i = 0; i < inputBool.Length; i++) {
       inputBool[i] = false;
     }
0

New to Communities?

Join the community