Hey!
I may misunderstanding the usage of EmplaceAt but if I do something like this:
UTestObject* NewSlot = DuplicateObject<UTestObject>(DefaultSlot, this); InventorySlots.EmplaceAt(Index, NewSlot);
The engine crashes.
UTestObject in an UObject instantiated inline (but I got this crash using a nullptr as well) and EmplaceAt Index is equals to 3 (any value different than zero should do the job).
Code is pretty simple so I may be doing something wrong, I thought that EmplaceAt would have reserved the amount of memory I need it but It’s crashing. I also tried call Reserve first with Index+1 and It changed the ArrayMax value but the crash is still present.
Would you mind to point me how I can inject an object in an array at the specified index?