For each loop Always returning Zero

Hi I’m having a problem, I am trrying to make an inventory system for my game. This system saves 2 arrays 1 is for which type is in each slot and the 2 is how much is in each slot. Each slot is decide by the index number of the item in the array. However whenever I call to get the index number as seen in the image below it always returns Zero. Am I doing something wrong? They are not used anywhere else until way after this is executed. Please note that this is my first time using arrays.

Edit: just for clarity there is a 4 avalable in the but it seems to ignore it?

1 Like

If this prints ‘0’, then yes, there is a 4, and it’s in the first slot :slight_smile:

Your right it was in slot zero which because of my error message was sending me down a false path. Upon hindsight i see that i am very stupid sometimes!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.