Hi again,
Sorry for another question, my array for the NPC is working perfect, he picks up an item, that item is then removed, then he moves to the next item.
So, now I have my player to also pick up these items in the same array. It works ok, except when I pick up an item, say item4 index 3, the array is updated but the item at index 0 gets removed and not item4 for example.
I have 2 FSM's on each item. One for the NPC the other for my player. And they are triggered each time an item is picked up, which then updates my Array.
I just need to know how I can get the index for the item my player picks up. The NPC works fine because I use GetClosestGameObject which returns the index, so I use that to remove from the Array.
So in my player FSM on my item, I Get Array List, I store the result in a GameObject. Then remove that object from the Array. And this is where my problem is. The result just returns the item at index 0, and I need the index to return the specific item the player has picked up.
Thanks for any help.