So I store my entire inventory in an array of a custom type “Collectibles” which inherits stuff like name, amount etc. to other item types like weapons. I just would like to add i.e. a weapon from the world to the player’s inventory array and then remove it from the world with the destroy actor function. Unfortunately, if I add an item to the array, only the reference gets added and as soon as I call “destroy actor”, the items in the inventory remain, but the properties are all wiped out. Is there a way to pass a spawned object as copy into a blueprint function?
Another approach would be to write this in C++ and pass it as copy there or I could also construct a new object of that type and set all the values, but I feel like that’s not good for the performance.
I also read about an inventory system where you create an actor that handles the pickup and drop.
I’m not sure what I should do. I hope someone can tell me which way is better. I don’t have a problem using C++ aswell, but I try to avoid it since Blueprints are easy to use (normally).
Thanks a lot in advance.