How Would I Get GameObjects Of Children

I’m trying to create a car damage script and I would like to get the GameObjectsInChild

public class CarDamage : MonoBehaviour {
	public WheelDamage WheelDamage;
	public BodyDamage BodyDamage;
	public EnginDamage EnginDamage;
	public GameObject WheelFrontLeft;
	public GameObject WheelFrontRight;
	public GameObject WheelBackLeft;
	public GameObject WheelBackRight;
	public GameObject Body;
	public GameObject Engin;


	// Use this for initialization
	void Start () {
		Body = gameObject;
		Engin = GameObject.Find ("Car_Engin");
		WheelBackRight = GameObject.Find ("Car_WheelBackRight");
		WheelBackLeft = GameObject.Find ("Car_WheelBackLeft");
		WheelFrontRight = GameObject.Find ("Car_WheelFrontRight");
		WheelFrontLeft = GameObject.Find ("Car_WheelFrontLeft");

	}
	
	// Update is called once per frame
	void Update () {
	
	}
}

public enum WheelDamage{
	Perfect,
	Good,
	Ok,
	Bad,
	Destroyed,
	None
}

public enum BodyDamage{
	Perfect,
	Good,
	Ok,
	Bad,
	Destroyed,
	None
}

public enum EnginDamage{
	Perfect,
	Good,
	Ok,
	Bad,
	Destroyed,
	None
}

Following your approach with GameObject.Find(…) you just have to add .gameObject to your statements like so:

       Engin = GameObject.Find ("Car_Engin").gameObject;
       WheelBackRight = GameObject.Find ("Car_WheelBackRight").gameObject;
       WheelBackLeft = GameObject.Find ("Car_WheelBackLeft").gameObject;
       WheelFrontRight = GameObject.Find ("Car_WheelFrontRight").gameObject;
       WheelFrontLeft = GameObject.Find ("Car_WheelFrontLeft").gameObject;

Edit: You don’t need three different enums if they contain the same elements. Just decalre a single enum damage:

public enum Damage{
    Perfect,
    Good,
    Ok,
    Bad,
    Destroyed,
    None
}

And derive the others from this one:

    public Damage WheelDamage;
    public Damage BodyDamage;
    public Damage EnginDamage;

ps.: your engines are missing an ‘e:wink: