Reverse Find in Array

Hi, i am currently attempting to make a crude RTS, and i have a build queue for units. however i want to be able remove an item from the queue without removing index 0, as this will reset build timers. instead i want to remove from tha back of an array. (the first item of a certain name). and i cant figure out a way of doing this.

there is a built in FIND function for arrays but it goes from 0 > N i need one that will go the other way. so i can find the index of a specific item and remove it from the back, rather than the front.

Just iterate normally by using a for loop and simply set the index to ArraySize - index - 1; Then you can check the value yourself and break if it is the correct one.

HTH

Use a for loop, First index is array.num() last index is 0 i–. Than check it array[i] == whatever you are looking for. If that is true, i = -1 and remove thar index.

i managed to find a workaround with this BP function my own little loop :slight_smile: :