how do i use GameObject.FindGameObjectsWithTag() on lists

var spawnPoints:GameObject;
function Start () {
spawnPoints=GameObject.FindGameObjectsWithTag(“spawn”);
}

this works fine but when i change spawnPoints to a list i get this error"Cannot Convert UnityEngine.GameObjectto Systems.Generic.List…

Remember that while they can often be used in the same way, an array and a List are fundamentally different things. You can’t just assign an array to a list reference and expect them to work.

However, the List API comes with a function for doing exactly what you want to do here!

Just use

spawnPoints.AddRange(/*whatever you need to add*/);

and you are good to go.

Remeber that spawnPoints needs to have been created before you can add stuff to it- you will need to allocate a new List object or you will get a Null Reference Exception when you try to add new items to it.