How to adress a Transform inside a arraylist that's inside a arraylist.

I am trying to put a arraylist inside a arraylist and then put transforms inside the arraylist that is already inside the first arraylist. I tried the following. The debug I put in there returns a Null item but if I look at the count it says 7.

public class Main : MonoBehaviour {

private List<List<Transform>> playPieceList = new List<List<Transform>>();

void PieceSpawner()
{
List<Transform> playPieceListInside = new List<Transform>();
playPieceList.Add(playPieceListInside);
	for(int e = 0; e < 7; e++)
	{
		Transform tempPlayPiece;
		Vector3 posPiece = new Vector3(0.1708656f - 0.0574332f * e, 0.1f, -0.228953f);
		tempPlayPiece = Instantiate (playPiece, posPiece, Quaternion.identity) as Transform;
		playPieceList[0].Add(tempPlayPiece);
	}
playPieceList.Add(playPieceListInside);
Debug.Log(playPieceList[0][0]);
}

}

The debug returning a null means that the content of position 0 in the list inside the master list is null. This is most likely a result from the Instantiate going wrong. Put a debug to find out if the for loop actually instantiates objects and that the object is valid. Maybe the prefab reference is null or you could try instantiating it as a GameObject first and adding its transform to the list.

Another thing is that you are adding the list two times (at line 6 and 14) to the master list, you probably want to add it just once.

Also, don’t say ArrayList when you mean List. =P