I have a base class with two main types of sub-classes, one of them overrides a function to make it blueprintimplamentable, the other one overrides that same function in the .cpp.
I’d like to declare an Array that can hold either type, and that it can be added to from either a BP or from the .cpp.
RIght now I put *UClass as the array type, but that isn’t working at runtime though it compiles. How should the Array declaration look?
Dear Mike,
When you ask your questions please provide the code, though it is not required conceptually it makes answering you much easier, since the idea is to answer you with code
Your question itself seems straightforward to me
Just do this
TArray YourArray;
Post more code and any errors you get and let us know 
You can’t assign Blueprints into that. I’'ve been using *UClass. I don’t have access to my Rocket project during the day so I have to post from memory. I don’t think this required I post code. I included the type that I am using, and that it was not working.
Well actually the code would have helped because I did not understand that you are trying to make an array of Blueprints until your 2nd comment
so posting code from memory would be nice 
To further emphasize my point
are you writing out
TArray<*UClass> MyArray;
or are you doing
TArray MyArray;
because the latter should work just fine
TArray MyArray;
If you are asking about code, find a way to write us the code or it will take much longer to answer you
I don’t think he quite understands how to ask his question. I think what he’s conceptually getting at is this:
- UObject → UMyBaseType → UMyDerivedTypeCPP
- UObject → UMyBaseType → MyBlueprintType
"Both “UMyDerivedTypeCPP” and “MyBlueprintType” have a function on them with the same name. (I’m assuming that function is exposed to script on “UMyDerivedTypeCPP”). “MyBlueprintType” is a blueprint that derives from UMyBaseType in the editor, however “UMyDerivedTypeCPP” is a concrete C++ class. He wants to keep a single list containing both inherited types.
I think he wants something like this:
TArray<UMyBaseType*> MyListOfAllDerivedTypes;
I’m assuming it’s because he’d like to iterate over the list and call the named function on each item. I can see why you’d want to do it this way. You could prototype quickly in a blueprint (perhaps a designer creates the first draft of the function). Then in testing you find that it’s slow. A programmer creates a C++ class that takes the place of the blueprint class and the function is rewritten to make it quicker.
Hello,
This is a question from the beta version of the engine. We are marking this answered for tracking purposes. If you are experiencing an issue similar to this please post a new question.
Thank you.