How can i access all the objects with whom my script is attached to ???

I am only able to access only first child( there are 5 more) , i want to access all 6 at once . I am talking about this line ChangeColor ChangeColor1 = thePlayer.GetComponentInChildren();

 using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class onClick1 : MonoBehaviour {

	public Text ScoreText;
	private int Count = 10;
	private int wrongAnswer = -5;
	public bool hello;

	public    void SayHello(  bool hello = false ) {

		
      if (GetComponent<Image> ().color == GameObject.FindGameObjectWithTag ("DisplayButton").GetComponent<Image> ().color) {

			GameObject thePlayer = GameObject.FindGameObjectWithTag("GameController");
			DisplayColor displayColor = thePlayer.GetComponentInChildren<DisplayColor>();
		

			ChangeColor ChangeColor1 = thePlayer.GetComponentInChildren<ChangeColor>();


			hello = true;
			displayColor.changeColor();
			ChangeColor1.ColorME();
			ScoreText.text = "SCORE: " + Count;

		
		
		
		} else if (GetComponent<Image> ().color != GameObject.FindGameObjectWithTag ("DisplayButton").GetComponent<Image> ().color) {
	
			hello = false;
			ScoreText.text = "SCORE: " + wrongAnswer;
		
		}
		}
	
}

You are using GetComponentInChildren. This will only return one of the specified component. What you need to use instead is GetComponentsInChildren. Note the ā€œsā€ indicating plural :wink:

Edit: The complete code:

 DisplayColor[] displayColors = thePlayer.GetComponentsInChildren <DisplayColor>();
  
  foreach(DisplayColor displayColor in displayColors) {
       Debug.Log(displayColor.gameObject.name);
       displayColor.changeColor();
          
  }

   ChangeColor[] changeColors = thePlayer.GetComponentsInChildren <ChangeColor>();
      
      foreach(ChangeColor changeColor in changeColors ) {
           Debug.Log(changeColor .gameObject.name);
           changeColor.ColorME();
      }