Is it possible to restart my for loop under a certain condition? What im trying to accomplish is getting a tile that is not on the border of the map using a for loop but for some reason it is still placing the tile on the border. I thought it had something to do with the for loop not looking through the previous border index in the list, hence why i wanted it to start from 0 again. here is my code:
for(int s = 0; s < borders.Count; s++){
if(start != borders[s]){
Debug.Log("Placing start tile at " + start);
}
else if(start == borders[s]){
start = Random.Range(0,tiles.Count);
}
}
Also i would like to note, there is nothing wrong with the borders because i checked what all the tiles in the border list were and the match perfectly with the outside of the map.
↧