private static void CreateInArea() { var gos = Selection.gameObjects; const int count = 100; GameObject parent = new GameObject("AutoGenerated"); Vector3 from = new Vector3(-5000, 0, -5000); Vector3 to = new Vector3(5000, 0, 5000); for (int i = 0; i < count; i++) { var prefab = gos[RandomTool.NextInt(0, gos.Count() - 1)]; var go = GameObject.Instantiate(prefab, gos[0].transform.position + new Vector3(RandomTool.NextSingle(from.x, to.x), 0, RandomTool.NextSingle(from.z, to.z)), Quaternion.identity) as GameObject; go.transform.parent = parent.transform; } }