In a function, given a ustruct type or a UScriptStruct, how can I create an instance of a specific UStruct
For example, I have FBaseStruct and FDerivedStructA, can I somehow create an instance like below:
void func_A(USctiptStruct* structType)
{
FBaseStruct* structPtr = new ??? /*info in structType*/;
}
I know NewObject() can be used to create an instance of a derived UClass, but I can’t use this method for UStruct.