can someone help me find the problem here

ok so this the part of my blueprint that the character when put a bottle back this function will look from last to first to see a invis bottle and make their visibility true but it doesnt work ,it was working a few days ago but now it doesnt work ,and in the tick node if put it like this in the image (first index =length -1 and last index=0) it will give me 0 as result and if reverse this it would give me -1 how can i fix this i used ai it didnt do anything i watched bunch of videos and im really stuck please can someone help me with this

Tracking the issue based on your blueprint graph is difficult, but at first glance, this subtraction seems redundant.

Let’s do a simple check:
First index = (length -1)

Current index = would be (length -1)

So the result is 0

i think there is Reverse For Loop, maybe that would be better to use to reverse scan array

now it shows the number nine it doesnt go all the way to number 1 (or in array 0) it stops at 9

There is, and it should be just what OP needs.

So the issue is something else, as I said before, it would be really hard to track the issue with a partially shared of the blueprint graph, i would suggest to put a Breakpoint there and debug it

thank you for your help i used reverse for loop and it fixed it ,still has problem the it spawn 2 bottle insted of one but the problem of putting back the bottle is fixed at least ,again thank you