MissingMethodException: System.Collections.Generic.List

I get this error when trying to add a transform to my generic list using javascript.

`var Roads : List.< Transform > = new List.< Transform >();

function Update(){

if(currentRoad == null){

currentRoad=Instantiate(intersection,hit.point,Quaternion.identity);

Roads.add(currentRoad.transform);

}

}`

If I add a transform to the list in function Start(), it works properly.

Sorry I’m not sure How to add a nice code box.

put an import statement for the namespace at the top of the script, add should have a capital “A”:

import System.Collections.Generic;

var Roads : List.< Transform > = new List.< Transform >();

function Update(){

  if(currentRoad == null){

    currentRoad=Instantiate(intersection,hit.point,Quaternion.identity);

    Roads.Add(currentRoad.transform);

  }

}