How to make multiple gameobjects child of one and the same transform (SCRIPT)

So I made a building system in my game and all the blocks I can place are tagged with the tag “Block”.
So and now I want that every placed block should be a child of the same transform. So I mean when I place 10 blocks all 10 blocks should have the same parent. I hope you can help me !

have a look at this

block.transform.parent=Yourparent.transform;

HI, there try this code, i wrote it for you and it’s working fine.

public GameObject[] AllObjects;
public GameObject ParentObj;

// Use this for initialization
void Start () {
	AllObjects = GameObject.FindGameObjectsWithTag ("Bomb");
	foreach(GameObject obj in AllObjects){
		obj.transform.SetParent (ParentObj.transform);
	}
}