Hello! I am still learning a lot and I'm new to posting (I hope this is the correct spot), but I've come across a problem with my code that I can't seem to solve. Here a detailed description of the situation (MAIN ISSUE listed lower):
I start by spreading IDs through tiles in the map and then assigning a random value to "distance"
Always spread 0 in ID of "sensor" object.
I then have a main loop that will cycle through all tiles in the map. When ID = loopindex, it will create 4 "sensors" N S E W of the tile. Next, I run the first nested loop. This loop runs # of "sensors" times. When ID of sensor = loopindex( nested1 ) and sensor is overlapping a tile, take the "distance" value and store it in the sensor.
Once the loopindex ( nested1 ) = number of sensors, I start a loop "findhighest" # of sensors times. The next bit of code determines which of the four sensors has the lowest stored value (that they got from the tile they are on top of) and erases the others. Once the loopindex ( findhighest ) is equal to the number of sensors, I run 1 loop ( setdirection ). On loop, if ID (tile) = counter-stored loopindex( main loop ) , set direction to look at the one remaining "sensor" and then delete it.
I told Fusion to run the main loop 1 time (to set up a controlled environment). The code as is causes the desired results. Once I up the main loop (called VECTOR) repetitions to anything higher than one, it skips to the very last tile and then completes the nested loops. If anyone is brave enough, I've attached the project file. I did my best to organize it for easy reading.
Thanks ahead of time to anyone who can help me out!