Hi, I need the player drop the first (or last) inventory element when reach a trigger.
(when he pass though a zone in the game (a trigger) the first (or last) item falls to the ground, so I need:
a) remove first (or last) element from inventory
b) instantiate prefab in the scene based on the item left in the ground
eventually move the rest of items one step to fill the first (or last) slot in inventory, to get room to take another object. (something like an FIFO queue, I have 4 items and the first outs, the rest moves 1 step in inventory and the new element enters to the end of the list)
I don't see a way to do this with AC.
Maybe in combination with Playmaker?
Thanks
Comments
AC.KickStarter.runtimeInventory.localItems
If you use it to find the first item (e.g. localItems [0]), then you can pass that to the function runtimeInventory.Remove (InvItem _theItem). You can also read this item's ID or label, to work out what prefab to instantiate.