Blueprint Actors as Components?

I’m building a game where players hold objects, but these objects need to have blueprints (due to implementing some logic-relevant interfaces). I tried StaticMeshActor, but that cannot be added as a component. I searched the possible parent classes for anything saying “Component” - nothing. Is there any way to add blueprint Actors to other Actors as Components?

1 Like

Hi,

Sure there is! You can build a blueprint based on ActorComponent and then add it to any other blueprint that inherits from Actor (i.e. Actor itself, Pawn, Character, etc.). Simply right-click anywhere in the content browser > Blueprint Class > Actor Component. Name it whatever you like and similarly create another blueprint class but based on Actor. Open your actor blueprint and from the left panel, click Add Component and search for the name of your newly created ActorComponent. You should be able to see it and add it to your actor’s component list.

Hope this helps :slight_smile:

1 Like

Found that out too, thanks. No idea why I couldn’t assign it as parent class afterwards.

Hi Grot13,

The difference is that you cannot add blueprints that have the base Actor somewhere in their inheritance chain (i.e. they inherit from Actor class) as a component to other actors. The child blueprint that you’re referring to is actually using inheritance. It’s an object-oriented concept and it is not limited to Actor or Actor Component. You can create child blueprints from Actor Components and all that means is that child will inherit its parent functionalities and will have access to them.

Actor component here is different. Consider Movement Component in Character. Movement component is not something that you want to add to your level. Instead, you will attach it to the character actor so that it can take care of movement functionalities of its parent actor (or the actor it is attached to). The good thing about these actor components is that they can tick, and they will show up in the component list of your actor, so you can access its properties and tune them very easily inside the editor and blueprints. So, for any such class that will add some functionalities to your general actor, you would want to use actor components. All these components together, contained in your actor, will make your actor behave the way you want. Take a look at Character blueprint and see all its actor components - Mesh, Camera, Movement, Collision Capsule.

Hope this answered your question.

Hi!
What is the point using an actor component instead of a normal actor ?
I have an actor class that uses several other actors as child blueprints, should I use actor component instead, and if so is it possible to convert them ?

That seems more convenient indeed.
Thanks a lot for your answer !