Perhaps there is something simple to this I am missing?
I have a parent class UMyAbstractParent, and it is marked as abstract. (Parent is UObject)
I have some instantiable classes which derive from this parent, lets call one UMyConcreteClass
which is blueprintable.
There is a blueprint function which has (TSubclassOf itemType) as parameters.
The function basically wants to do this:
UMyAbstractParent* newItem = NewObject<UMyAbstractParent>(itemType);
Obviously we are never going to try to instantiate the abstract base class, only derived concrete classes…
HOWEVER, this line of code as written dies, because the engine asserts that the templated class is abstract.
All the versions I can find of NewObject are templated ones, and I was unable to find a way of passing a flag or something to get it to skip the assertion.
Is there another/better/accepted way to do this that i don’t know about?
I would really like to keep the base class as abstract, because it makes sense.
And I really don’t want to have to do something hacky, like implement a concrete intermediate class that the abstract base class derives from, just to feed something ‘acceptable’ to the NewObject() function.