each subclass should be in C++, not only as a blueprint
Then you make blueprints of each subclass that you want other team members to do BP stuff for.
All key variable data should be in c++ but functions can be implemented in the BP using BlueprintImplementableEvent, if other project members want to be the ones making those functions
it will make your life very happy later on in your project’s life cycle
then you can use the C++ class in the TArray
Summary
C++ is the foundation, the skeleton, which BP can flesh out, but all key data must have a presence in the C++, classes and all key variables, and function definitions.
But actually this is how I am using it.
My designer only fills out some fields with numbers, and my technical artist is using my generated events for animations and visual fx.
For this particular situation, my designer is allowed to add as many items to a loottable of a enemy. For this reason i have a struct with the item he designed (also dynamic with filling out all uproperties) and the drop chance.
It would be obvious a bad thing to hard code every item. Further more i gave my designer the class, he blueprint extend and then add it to the item field of my struct in the edior.
To prevent a non-programmer to past any blueprints in and cause crashes, I want to only allow him to put in the extended BP of my item class.
Well in the class where you are doing your core logic you can make a single property no one should mess with, that will accept your “extended BP class” that you are saying is parent of all the various items.
/** Do Not Modify */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = ItemBPClass) UClass* ItemBPMasterClass;
#IsA Test
and then in your cpp you can do an IsA check on any classes that your project members put into the UClass* array
thanks for your help. But everything u say I’ve already done.
My point was out of the view of my designer.
To catch the null point references if he past in the wrong class is basic.
My point was to automatic only show him the right classes in the drop down field, when he past it in. He should only get the right classes as options to choose from.
So if I make it i.e. APawn class, there will be only the chance for him to put in APawn in. This is what I want.
Hope it’s now clearer. Anyway thanks for the try.!
Not sure if you still need this but this worked for me:
TArray<TSubclassOf<class UClass>> ArrayName
This way they will show up filtered on lists in Editor - Parent itself and all subclasses created of it (Through blueprints or code). If that was the functionality you were seeking.