How to make an IList of a certain type?

I’m trying to make an IList of the type Vector2. Why doesn’t this work…?

IList<Vector2> borderPixels;

Do I have to import something?

Because IList is an interface, not a class. Look up the interface keyword and abstraction/inheritance for more information, but you can never instantiate an abstract class or interface. You’re probably looking for the List<> class instead.

Make you class inherit from System.Collections.Generic and change the datatype from IList to just List.

List<Vector2> borderPixels = new List<Vector2>();

That should do the trick.