How to create endless board game path

So I’m making an endless RPG type board game, but I’m having trouble with setting the route for player to move.

On “Start” function I instantiate custom amount of “Road” prefabs (“Road” is a 10x10 green shape which has custom “road cut out” filled with 1x1 brown road tiles), which have different directions. When these prefabs are instantiated I parent them to the GameObject that has Route script attached to it and put only brown tiles into a list that makes up the road. Then using OnDrawGizmos I pick every single tile and try to plot the road with green line, but in the picture it’s clear that green line is all messed up and doesn’t follow a path (By the way the start is bottom right). In list I can see that tiles are put in random order, but I can’t seem to figure out how to sort or put them in a list so that they create a normal path.

public class Route : MonoBehaviour
{
    GameObject[] childObjects;

    public List<Transform> nodeList = new List<Transform>();
  
    private void OnDrawGizmos()
    {
        Gizmos.color = Color.green;

        FillNodes();
        for (int i = 0; i < nodeList.Count; i++)
        {
            Vector3 currentPos = nodeList*.position;*

if(i > 0)
{
Vector3 prevPos = nodeList[i - 1].position;
Gizmos.DrawLine(prevPos, currentPos);
}
}
}

void FillNodes()
{
nodeList.Clear();
childObjects = GameObject.FindGameObjectsWithTag(“Tile”);

foreach (GameObject child in childObjects)
{
if(child != transform)
{
nodeList.Add(child.transform);
}
}
}
}

@Vollmondum This will keep track of the order of the big tiles, but the small tiles are instantiated in with the big tile prefab it sounds like, so he never actually instantiates the tiles he needs to keep track of. You have a few options here when it comes to sorting your small tiles but here are the first that came to mind.
**
Instead you can sort the order of the tiles in your transform hierarchy inside your prefab according to the actual order of the tiles in game. Then you can look at their Transform.GetSiblingIndex() in order to read what order they are in inside the large tile prefabs. This requires the least manual work but is a little hacky.
**
You could also just attach a script to the large tile prefabs that keeps track of all its children tiles in an ordered list. The downside here is that you have to manually drag and drop all of the tiles into this list for each prefab that you have, but the upside is that you can just append these lists to the main one when you generate your overall path list.
**
You could always write some kind of algorithm that starts at the beginning of the path and has each tile check for the closest tile using something like Physics.CircleCast and just build your list one node at a time, but that sounds like a lot of excessive coding and debugging.

You don’t “fill” your list with Find. You need to fill it while instantiating.
var instance = instantiate…
myList.Add(instance);

That will keep track and order.