I want to iterate through two lists, (listA and listB) element by element.
listA element 0, then listB element 0, then ListA element 1, then listB element 1 etc.
i tryed to achef this trough a nested for loop (see example).
But this code starts with listA element 0, but then all ellements of` listB will pass.
What do i have to change to iterate element by element?
for (int i = 0; i< listA.Count; i++)
{
placeHolderPosition = ListA*;*
Debug.Log(“placeholderpositie” + ListA);
for (int t = 0; t<listB.Count; t++)
{
bookPosition = listB[t];
Debug.Log(“boek” + listB);
}
}
//float dist = Vector3.Distance(placeHolderPosition, bookPosition);
//Debug.Log("Distance to other: " + dist);
}