how could I make a bool true and make other bools false?

I wrote a code but it’s a little large and not working fine , I just wanted to know is there a better way or not.

public bool a1;
public bool a2;
public bool a3;

void Update(){

if(a1   ){
a2=false;
a3=false;
}

   if(a2   ){
   a1=false;
   a3=false;
   }

  if(a3   ){
   a1=false;
   a2=false;
   }
}

also when a1 is true I can’t make other bools true.please help xD.

hi;
always put “Else” for your “if” statements otherwise each “if” will work in update method;

 void Update(){
 if(a1   ){
 a2=false;
 a3=false;
 }
  else  if(a2   ){
    a1=false;
    a3=false;
    }
  else if(a3   ){
    a1=false;
    a2=false;
    }
 }

if u want to find a better way to wirte it i need to know what u want to do exactly;