Hi everyone !
I’m pretty new to UE4 C++. I’m on UE5. I’m coding a basic inventory system. I made a UInventorySlot (UObject) and a UInventoryComponent (UActorComponent). I just want to fill a TArray variable in the UInventoryComponent to init the inventory with empty slot. But it doesn’t work. At the end of the loop to init it, the TArray is full and correct, but when I try to access it via a function for example, the array is empty (num==0).
In the UInventoryComponent BeginPlay, I do this :
The TArray declaration in UInventoryComponent header :
The UInventorySlot class :
I have checked every forums, videos and documentations, I don’t find anything about this problem. Any idea ?