Hi everyone!
I made a simple inventory system using blueprints. Pickable objects have an structure, so when you pick them up they’re stored into a map and then destroy themselves.
Everything works fine, but now I want some objects to be interactable within the inventory. If it was just a consumable changing some stats I’d use structs, but I wanted to add some dialogues in which you inspect the object or manipulate it.
It would be easy if I could write the code of the interaction inside the interactable object: I could add a “UsingItem” function inside the parent class, override it on its child and make it do whatever I want, so in the inventory logic I could just check which item is selected, get a reference of it and call his “UsingItem” event.
The issue is that I can’t call any function since the object is destroyed when you pick it up.
If anyone has an idea about how can I cope this I’d love to read it!
Take care everyone!