- Home /
I cant Get the value of an Array
Hello, I want to get the value of an array
Player.GetComponent<Inventory>().inventoryTab[ItemSlotID,1]
I know that InventoryTab[0,1] = 1
( in the inventory script of the player ) when i test it but when i want to get it in another script with the previous line of cmd, the result is always 0
ItemSlotID also equal 0 (but this is normal)
I don't understand why this line don't return the real value maybe I did something wrong or I just can't do that with this cmd.
Hi!
Your code looks working, however, maybe you mistyped, maybe not, but for accessing you are calling: ...inventoryTab[....], meanwhile you said that you know the InventoryTab[...].
Your "i" in first case lower, but in the second upper.
However, if that was only an mistypo, can you say - are you able to retrieve other array values or only this specific?