Hi,
i’ve been trying to filter through a list of gameobjects in a while loop and removing them if they dont fulfill the condition. e.g:
while (myArray.length > 0) {
myGameObject = myArray.Shift();
//perform other checks with myGameObject
}
am i right in thinking that this should empty the array list? im not running this code in update() by the way. the code seems to go back into the loop even when the array length is 0?? this causes unity to crash.
Any ideas will be very greatly appreciated, really can’t get my head around why this is happening. i’ll try and add an exapmle of the code later today.