Blueprint child of c++ child of actor component

Hello,

I’ve created a c++ child class of actor component, let’s call it MyActorComponent.
It’s meant to be a base class for many other blueprint classes that I want to use for my actor.
Although, I can’t create blueprint child of MyActorComponent. The editor simply does not allow me to, saying “Cannot create a new blueprint class based on MyActorComponent”. I can create c++ one tho. Am I doing something wrong, or it’s impossible?

For clarity, what I want to do:
ActorComponent → MyActorComponent [C++] → ChildOfMyActorComponent [Blueprint]

1 Like

Can you create a new BP ActorComponent and re-parent it to your CustomActorComponent?

You can look at how USceneComponent was implemented, which might help:

By looking at the .h of SceneComponent, I noticed that the constructor had this macro

  • meta=(BlueprintSpawnableComponent ...)

Which is what you need for your component to be used in BPs. As confirmed by this page by rama that I found by searching for BlueprintSpawnableComponent .

I suggest you also use BlueprintType in the meta so you can pass references of your custom component.

EDIT:

Okay, found the solution by looking at VRNotificationsComponent

  • In your UClass macro use Blueprintable. And you’ll be able to make BP subclasses of your component.
2 Likes

Nope, it doesn’t even show in reparent list.

What does the code of the component look like in the header? It may require certain macros to allow it to be blueprint spawnable (Meta = (BlueprintSpawnableComponent)).

Updated answer, should help

My header do have this macro tho: UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) ) And I can use my component in a blueprint, but I want to create a blueprint that is not using, but a blueprint that is based on my custom c++ class (it’s meant to be information-only blueprint if that helps).

Your reply made me look into class specifiers and there I’ve found Blueprintable specifier, which is exacly what I was looking for, thanks!

Add Blueprintable specifier to class declaration.

UCLASS (Blueprintable, ...)
class ...
4 Likes

Hey, just found the same thing in VRNotificationsComponent