Getting this warning:
ConstructObject is deprecated. Use
NewObject instead
However, I looked at the UObject Instance Creation docs and can’t find a proper substitute. I need to be able to pass in a name, parent (outer), flags, and most importantly a UClass
of what I actually want to construct. NewNamedObject
has most of these but lack the Class parameter–it does have a Template parameter but it crashes with the following message when I attempt to pass the class to it:
Assertion failed: !InTemplate ||
InTemplate->IsA(InClass) || (InFlags &
RF_ClassDefaultObject)
So how do I change this:
ConstructObject<UObject>(Class, Parent, Name, Flags);
To something else?