Adding a struct to an array

I’m working on a simple inventory system for a side-scrolling game. I have a function, shown below, that has an item Actor as input, turns it into a struct and tries to add it to the inventory’s item array. I’ve done a bit of debugging on this and when the item comes into the function, it’s variables such as the item’s name are set properly (they are specified via the level editor.) However, after I create the struct and add it to the array, when I try to access the item from the array, variables such as the item name are blank.

Suggestions? I’ve been battling this strange issue for a couple days now and I’d be happy to provide any additional information as necessary.

I just noticed that it was added by ref. Removed the DestroyActor node and things are working at the inventory level now, but of course the item is not removed from the level. Is there a way to copy in by value?

My guess is the problem is caused by DestroyActor node.

When you assign the actor to the InventorySlot you only store a reference to this actor, not the object itself, so when you call Destroy it will remove all it’s data. Then your reference is pointing at nothing - hence blank values

If you need it to be of class Actor then I would set visibility off and removed collision.

Even if you cloned it and deleted original, remember that Actor is something that exists in the environment so the newly spawned one would just appear in-game