So I have function that simply is suppose to add stuff to it however when i test it after in the function im getting a null object?!?!?!? Please help!! from the log i get null then 121.
public List<PathNode> NodeList;
public int size;
public GameObject Node;
public void createNodeGrid()
{
for(int i=0;i<=2000;i+=200)
{
for(int k=0;k<=2000;k+=200)
{
PathNode tmp;
tmp= Instantiate(Node, new Vector3(i, 20, k), Quaternion.identity) as PathNode;
NodeList.Add(tmp);
}
}
Debug.Log(NodeList[0]);
size = NodeList.Count;
Debug.Log(size);
}