Ah, you’re trying to create persistent inventory. Well here is the thing. While GameInstance does exist between level loads, the actors that are you adding to your inventory do not. They exist in the current world and just storing a pointer to them in a TArray doesn’t change that. Then when you call PickedUpItem->Destory() it quite literally destroys them in the current world. In fact at that point you now have a dangling reference in your TArray which is a potential crash waiting to happen. When they are destroyed, it doesn’t happen right away. They are flagged as pending delete and are hidden/no longer updated. However they aren’t really removed until the next garbage collection. That’s why you don’t see it reflected in your menu until after GC.
So there are a couple of ways to do what you’re looking to do. One, you can add a step when transitioning from world A to world B that recreates your inventory in B. You need to dig in to the whole loadmap loop but it’s not terribly scary. This is the most flexible because you’re essentially making sure the inventory is carried over.
You could store just the class of the inventory item. This has a bunch of limitations but certainly workable. You add the class, delete the actor and respawn the actor when used.
You could utilize the persistent level and stream in sublevels instead of changing maps. This is probably the best bet if you’re doing a single player only game.
You could implement a checkpoint like system where you save the player’s state (including inventory) when you start the level load, then restore it on load complete. I believe there are a few packs in the marketplace for this type of system.