Adding item into inventory after buying it off from the "shopkeeper"

Hello! I’ve got a question about adding an item to inventory after I buy it from the shopkeeper NPC. I have created an child blueprint which contains all the necessary information about the item and even the item ID. The problem is that in the shop it shows the item picture correctly. For example I open the shop and click on the carrot, it takes the correct amount money off the player, but it doesn’t give the player correct item. For extra information my items are all created from a “master item” (actor) and their all child blueprints of the “master item”. My main problem is that if i want to add the item to my inventory I need a actor object reference, but I can only create an array of items for the shopkeeper NPC with class reference (meaning an array). I just wanted to know if its possible to connect them and get the right item. Thanks!

And on the first picture is an ItemDataTable thats just an experiment that I tested.

Hi @MangoPenguin2601

You could consider just a datatable of pseudo item list rather than actually creating an actor each time for inventory. Would save on overheads in the engine, only create an actual actor if its viewable int the world.

But obviously you would need your item to have a reference to the class to make the actor, then all its default stats and attributes.

Use SpawnActorFromClass to create it.

Stewart