Create Variable in C++ pointing to a TSubClassOf a Blueprint

Gday All,

I want to create a variable in C++ that points to a child of Blueprint Actor Component, something like this;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ItemDetails")
		TSubclassOf<USRAC_Base> ItemClass;

But it tells me Class USRAC_Base is not found :frowning:

I have tried using ConstructorHelper::ClassFinder, ClassLoad, etc. but nothing seems to work, If anyone can help with this would be awesome, Thanks :slight_smile:

All blueprint classes exist only virtually on run time, so there data is not accessible during compilation. Because of that you can not use blueprint classes as template arguments, as they don’t formally exist for C++.

You need to create a base C++ class for your blueprint, it can even be empty, just so you can refrence perticilar family of blueprint classes in C++.

I thought that might be the case, Thanks for confirming :slight_smile: