Hello, for my problem I obviously look on the internet before coming here you ask the question. But when I use GetComponentInChildren <> it gives me the component of the first child but I want all the composent of the children.
I want take the component and place it in two variable named left and right.I want two variables with different children to control my side shooting with boolean:
Code to take component ShootCanonFront:
ShootCanonfront left;
ShootCanonfront right;
void Start () {
left = GameObject.FindWithTag("LeftBoat1").GetComponentInChildren<ShootCanonfront>();
right = GameObject.FindWithTag("RightBoat1").GetComponentInChildren<ShootCanonfront>();
}
void Update () {
}
So my question is: How can i take ShootCanonFront components of childs Left object and place it to left variable and do the same for right variable.
I hope it’s understandable and thanks in advance ^^