What is the proper way to store a fixed size array of UObjects?

You can TArray fixed size this way TArray<Type, TFixedAllocator<Size>>

Note makes no much difference, TArray only creates illusion of dynamic array, they way it work is it allocates array of perticlar size and if you add more item then it can fit it will reallocate array to bigger size. You can prevent reallocation by telling array how much elements your array will have with Reserve function

As well you can shrink array when you know array wont change size anymore, so array will deallocate reserved space

Hey, what is the proper way to store a fixed size array of UObjects? Currently I have to use a TArray and just pretend that it’s fixed size because if I don’t store the UObjects in a variable marked with UPROPERTY (like std::array which can’t be marked with UPROPERTY) the garbage collector deletes my UObjects leading to a crash.

Thanks!

Does using TFixedAllocator actually limit the size that the array can grow/shrink to? If not, this isn’t helpful for what I want.

Use TStaticArray