Hey there, me again!
So I'm kind of confused here on the workflow.
I do have an equippable item that represents a seedbag and is stackable.
Let's say I do have 4x tomato seed and have the item equipped in hand, ready to place some plants:
The seed animation contains an ExecuteEvent that the item listens to, in order to validate if the player is able to place the plant wherever he tried to. That works and I am able to spawn tomatos where I want to.
Not upon that spawning I want to reduce the tomato seed count by one, ultimately unequipping and removing it from my inventory when there are no seeds left.
The things I tried:
1. Access the Item Component on the gameobject and call the Remove() function in order to remove one from the stack => did not work
2. Access the ItemObject Component on the gameobject and call SetAmount() to reduce the amount. This kind of did work, but did have no real effect in the scene.
3. Access the Inventory from the above ItemObject and try to remove one of the ItemIdentifier from the Inventory... Did not work.
I don't think my code-based approach is bringing me anywhere... Please send me off into the right direction once again!
Kind regards
So I'm kind of confused here on the workflow.
I do have an equippable item that represents a seedbag and is stackable.
Let's say I do have 4x tomato seed and have the item equipped in hand, ready to place some plants:
The seed animation contains an ExecuteEvent that the item listens to, in order to validate if the player is able to place the plant wherever he tried to. That works and I am able to spawn tomatos where I want to.
Not upon that spawning I want to reduce the tomato seed count by one, ultimately unequipping and removing it from my inventory when there are no seeds left.
The things I tried:
1. Access the Item Component on the gameobject and call the Remove() function in order to remove one from the stack => did not work
2. Access the ItemObject Component on the gameobject and call SetAmount() to reduce the amount. This kind of did work, but did have no real effect in the scene.
3. Access the Inventory from the above ItemObject and try to remove one of the ItemIdentifier from the Inventory... Did not work.
I don't think my code-based approach is bringing me anywhere... Please send me off into the right direction once again!
Kind regards