You cannot randomize a foreach because it internally uses the order of the collection. But you can randomize your collection priorly:
Transform [] RandomChilds() // Here is a teaser for grammar nazis
{
List<Transform> list = new List<Transform> ();
foreach(Transform t in transform)
{
list.Add (t);
}
Transform [] array = list.ToArray ();
for (int i = 0; i < list.Count; i++)
{
int rand = Random.Range (0, list.Count);
Transform temp = array[rand];
array[rand] = array*;*
void Start() {
//Create list for state of child into transform and initialization
List<int> tpChild = new List<int>; //maybe use bool list or array
for(int i = 0; i < this.transform.childCount; i++) {
tpChild.Add(i);
}
//Find random object
for(int i = 0; i < this.transform.childCount; i++) {
int num = Random.Range(0, tpChild.Count);
Debug.Log(this.transform.GetChild(tpChild[num]));
//Remove element from list
tpChild.RemoveAt(num);
}
}