Cannot create Blueprint class based on C++ UActorComponent

I have a custom UActorComponent written in C++ and wanted to extend that in the BP editor, but when I tried to create a Blueprint class based on my C++ class I couldn’t find it in the class list. And, going through the C++ object in the editor I noticed that “Create Blueprint class” is disabled:


I’ve compared the code to other classes which I can create Blueprint classes for, and not much is different other than the class their parent class. Is there something I could be doing wrong? Here is the header file for this class:

UCLASS()
class RH_API URHTriggerComponent : public USceneComponent
{
	GENERATED_BODY()

public:	
	class USphereComponent* Collider;

	// Sets default values for this component's properties
	URHTriggerComponent();

	// Called when the game starts
	virtual void BeginPlay() override;
	
	// Called every frame
	virtual void TickComponent( float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction ) override;

	virtual void Use(APawn* User);

	UFUNCTION(BlueprintImplementableEvent)
	virtual void OnUse(APawn* User);
};

Thanks!

6 Likes

Declare with UCLASS(Blueprintable) instead of UCLASS()

10 Likes

Here’s the corresponding piece of documentation:
https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/Reference/Classes/Specifiers/Blueprintable/index.html

1 Like

Oh, interesting. So is the reason I don’t have to do this with some classes because the parent (in most of these cases AActor) is already defined to be Blueprintable?

Yep, that’s why! Blueprintable is an inherited property

1 Like

Thanks!