I’ve been trying to figure this out by myself for a couple of hours now, and Googling didn’t help. Anyways, I have two lists of Vector3:s called VectorList1 and VectorList2. Now I want check for every Vector3 in the first list: does the second list have a vector with that x-value?. Anyone have any idea how this can be done?
This doesn’t work, but I put it there if it’s easier to see in code what I want to achieve, than my explanation:
private List<Vector3> VectorList1 = new List<Vector3>();
private List<Vector3> VectorList2 = new List<Vector3>();
// [Code where vectors has been added to to both lists]
for (int a = 0; a < VectorList1.Count(); a++){
if (VectorList2.Contains(VectorList1[a].x)){
Debug.Log("VectorList2 has a vector with that x-value");
}
}