title: Button onclick changing colour following a situation not working. C# unity
body: <p>Sorry for the simultaneous question, just this one has been griping me for a while.</p>
  
  <p>Back onto these 4 button things (following the last post), I wanted them to go green following a 'correct click'. So if one person clicked the right button, it would go green.</p>
  
  <p>Originally, I decided to make 4 variables and set them to 'y' and 'n'. If the user clicked the right button it would go 'y', which would then lead to the corresponding object to go 'green', and so forth.
  However, when I did this all of the buttons go green. Following a debug check, they all go green following one correct answer, which has me thinking that they are somehow connected (in a way I do not understand).</p>
  
  <p>Here is the code I used:</p>
  
  <pre><code>void Update () {
      Image image = GameObject.Find("Answer1").GetComponent&lt;Image&gt;();
      Image image2 = GameObject.Find("Answer2").GetComponent&lt;Image&gt;();
      Image image3 = GameObject.Find("Answer3").GetComponent&lt;Image&gt;();
      Image image4 = GameObject.Find("Answer4").GetComponent&lt;Image&gt;();
      if (randQuestion == -1)
      {
          randQuestion = Random.Range(0, 5);
      }
  
      if (randQuestion &gt; -1)
      {
          GetComponent&lt;Text&gt;().text = questions[randQuestion];
      }
  
      if (choiceSelected == "y")
      {
          choiceSelected = "n";
  
          if (correctAnswer[randQuestion] == buttonSelected)
          {
              Debug.Log("Correct!");
  
              if (Answer1script.answerCorrect1 == "y")
              {
                  image.color = Color.green;
              }
  
              if (Answer2script.answerCorrect2 == "y")
              {
                  image2.color = Color.green;
              }
  
              if (Answer3script.answerCorrect3 == "y")
              {
                  image3.color = Color.green;
              }
  
              if (Answer4script.answerCorrect4 == "y")
              {
                  image4.color = Color.green;
              }
          }
      }
  }
  </code></pre>
  
  <p>I have obviously done something wrong; any help would be greatly appreciated!</p>