I have an array of Vector3's from the polygon collider. I want to have an array of the indexes of all the Vector3's that are higher then a certain y.
private void Awake()
{
polygonCollider2D = GetComponent<PolygonCollider2D>();
float lowestY = polygonCollider2D.points.Min(x => x.y);
// So in the sentence below I want to have a array of indexes instead of a array of vector3's.
topPoints = polygonCollider2D.points.Where(x => x.y > lowestY).ToArray();
}
Can I do this with Linq?
Selectthat includes the index.