How to get child gameobject only

I have a a game that will instantiate multiple tanks in. I’m using this to find the top of the tank that rotates, but this finds the top one in the hierarchy so only one will turn:

head = GameObject.Find("Group 3").gameObject;

I want it to find the top that is a child of the gameobject with this code so each will turn their own tops, and not the first one in the hierarchy.

I have a a game that will instantiate multiple tanks in.

Every time you call Instantiate, it returns a reference to whatever object you just spawned. In many cases, people will ignore this value and then wonder how to find the instantiated object. Don’t do that.

Keep a list of the tanks you’ve spawned. Each time you spawn a tank, add it to the list. When you’re done with a tank (if that ever happens), you can remove it from the list. Instead of wondering how to find your tanks, just check the list. That’s much easier.

If you’re not sure how to do that, then now is a good time to look up some tutorials on lists and arrays.