I have a base blueprint class that I derive a bunch of other blueprints from. I have to convert this base blueprint class to a c++ class, then reparent the base blueprint class to the new base c++ class. However, my base blueprint class has a function that takes a class reference as input. How is this converted to c++ in a way that leaves the children blueprint intact?
Declare your function in C++ with an UClass reference.
UCLASS()
class YOURGAME_API : public AActor
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
void YourBaseFunction(UClass* YourClassArgument);
void YourBaseFunction_Implementation(UClass* YourClassArgument);
}
The BlueprintImplementable means this function can be overridden by a blueprint child and the specifier BlueprintCallable let it be called by any blueprint.
If you want to accept just children of defined class you can use the TSubclassOf.
EG: If you want to receive only classes who are derived from actors:
void YourBaseFunction(TSubclassOf<AActor> YourClassArgument);