How to get ue4 to stop garbage collecting my spawned actors?

Thank you!
Using the TSharedPtr didn’t prevent it from being deleted and then I got a read access violation crash after the item was destroyed. I did notice that the item only gets deleted when I add it to my InventorySystem’s Tarray of Items (this is an Actor Component class that I use for… inventory). I line trace for items from my player and if I have a blocking hit and hit the interact input (E) then the item hit by the line trace gets added to the inventory via a combo of these methods:



I’m not convinced it’s the functions themselves because when I pickup items that were placed in the editor (pre start game) those items never get deleted when I put them in my inventory. Do you think it has something to do with the TArray that I’m using to store the items for my player character? IT is marked with UPROPERTY as well