Hello all. I encountered a strange problem and wanted to ask some opinions on what direction to take.
I am making a C++ based Inventory system for my 3rd Person RPG by following tutorials below. So far everything works just fine. But I noticed after picking up objects, around 30 seconds after I pick them up they simply disappear from the menu. Whether the menu is open or close does not matter. They just disappear.
I checked the UI system first, seemed to be fine. Made a small function to print currently stored inventory items to be printed (with AddOnScreenDebugMessage) with a key. Strange thing is within this 30 seconds it works perfectly. But after that 30 seconds when items disappear when I hit the key to print items whole thing simply crashes.
It almost seems like I seem to lose access to inventory (which is an TArray of PickUpBase class I made. Inventory is stored/written into a custom C++ GameInstance I made.) . I also tried packaging the project to try in game conditions, and it is still the same.
I am lost at this point. I am sharing screenshots to show the problem and graph of how UI shows items. I am also sharing the necessary code.
Using 4.18.3
If anymore info is needed please let me know.
Code of PickUpBase, Character class, GameInstance class:
How does it seem.
UI graph.
The tutorial series I follow:
Thanks and respects.