As I just stumbled upon this issue while trying to create an object from a TSubclassOf
, I noticed that the first parameters of NewObject
is the Outer
or the owner class, the second parameter is the UClass
to create the object from. So the correct way to call it would be (UE4 4.20)
UDamageType* dmgType = NewObject<UDamageType>(this, DamageTypeClass);