For Loop looping out of Loop Condition
Hey guys,
So this bit of error is confusing the heck out of me. For whatever reason, the for loop is not exiting after the loop condition is met:
Notice the last 3 lines in the console, the loop is suppose to end after "Skipping: i: 1 j:1", but i just go back down to 0 and j goes out of range.
Here is the code:
Maybe I'm approaching this the wrong way, but the idea of this loop is to go through every array in the list "matchList" to find arrays that share the same object and if they share the same object, it'll first single out the object, and remove one of them from one of the array, and merge the two arrays into one, then remove the two old arrays. Once it has done that, It'll run the function again to find if there are more duplicates. Here is what I'm trying to do. Essentially, if there are two or more 5+ matches, it'll merge each 5+ matches into a single array rather then having two separate array. (also in the video, arrays are not merging)
The entire merging and removing duplicates of the array are working find, its just for whatever reason, this loop is not exiting out of the loop condition :C
Any help would be appreciated >3<
Answer by Chng · Sep 27, 2017 at 04:34 AM
Ok Solved it, after an entire day of staring at it xD
What was happening was new instance of the function was being call without exiting the prior one, resulting in them stacking up until it loop backs to the very first call again where the list.count has change.
Your answer
Follow this Question
Related Questions
Nested For loop Grouping 0 Answers
Why does this loop throw an error if int questComplete rises above 1? 0 Answers
LeanTween - For Loop Help 0 Answers
List, for loop and removal of items 2 Answers
Gameobject list does not retrieve the first index in for loop 0 Answers