How to instantiate multiple Prefabs in line and then repeat it?

// So, i have 3 prefabs. Each has 5 different gameobjects in it. How do i spawn them back to back and then loop them? //

// Like,… [spawn 5 objects from Prefab1 followed by 5 objects from Prefab2 and the same for the last Prefab3.] //

// Sorry, i don’t have a clear code for reference. Just trying new things by following tutorials. And no, i don’t have any experience in coding. //

Something like the below, but you have to work in your logic. Not sure if you have spawn positions/time between spawning, etc… But this allows you to set your desired amount of prefabs and their child prefabs in the inspector (It assumes all children are the same prefab for each of the parents). It loops through the prefabs you set, spawns them, and then spawns the given children and sets the said prefab as the parent.

[SerializeField] GameObject[] prefabs;
[SerializeField] GameObject[] children;

private void Start()
{
    for(int i = 0; i < prefabs.length; i++)
    {
        GameObject obj = Instantiate(prefabs*);*

for(int j = 0; j < children; j++)
{
Instantiate(children[j], obj.transform);
}
}
}