custom blueprint component cant have component ?

Hey,

i want to do “modular” blueprint with actor component (like in this video https://www.youtube.com/watch?v=5kltaGld6fQ or even better this modular game example: https://www.youtube.com/watch?v=qr4ZjieAQKY)

my question is can we add component to an actor component at all? we dont have the menu to add component like a normal blueprint, and we dont have construction script too (any reason for this?)

for example, when we add a character movement component to a blueprint we get a cylinder shape for collision, a skeletal mesh, …

cant we do this with “actor component”?

and last question, can we have this demo project https://www.youtube.com/watch?v=qr4ZjieAQKY (modular 2d space shooter game)?

Nope components cannot have components, at least i did not found way to do it in blueprints.

No, they can’t have Components. Not in C++ (i think), nor in BPs. They can only reference them.

You can have them in C++ but not in the BP. I don’t have a good C++ code example at hand, but this is one of the posts that confirms that it’s possible to do in C++:

The reason why there is no constructor in components as they are created after the actor itself is build. I guess, you could use OnBeginPlay to spawn some other components.

so if we want to do modular things, we have to build a proper blueprint with proper components in it, and then we can add a ‘module’ with actor component to it, because if my module use thing like a box shape, i will have to take care that i put a box shape in all my blueprint that i want to use this module

parent & child blueprint is better for this case right, i will ensure that all my child will have the box shape but the modular thing may be better if we want to add or remove some functionnality to certain actor, but its seem difficult to use them if we cant add component the ‘actor component’ we will have to rework the actor each time we add or remove a module

I’m not exactly sure which behavior you want to achieve. For example, I use custom scene components to apply physics forces to other components in the same BP. To make such custom components reusable, I need to provide them name of the component which they should effect. So in this case they don’t need to spawn anything themselves as content creator will provide them with a “name pointer”.
But lets look at another case, something like a wheel component which needs to have a wheel mesh and do some friction calculations. One option is to add wheel mesh separately and provide Wheel component a name of the mesh component. Or it can spawn wheel himself, but such behavior can be coded only in C++. The good news is that you don’t have to manually set what mesh to use every time. What you do is just create a custom BP component on a basis of your custom C++ component and choose a default mesh inside of it (you can set default mesh in C++ as well but then your reference will be tied to specific project structure and name). Now your new custom BP component can be used in any BP and it will have default mesh and all other variables. You can even migrate it with default mesh (it will be picked up by editor) into any other project as long as you bring your c++ code for your custom c++ component it was based on.

This post has a lot of “component” word in it, I hope it’s easy enough to read.

Components are great for enclosing some logic, so you do not “pollute” main blueprint with code.

For eg. I created component that checks parent for all point lights,
then it hooks to event dispatcher in game state,
This way by just dropping that component i can manage all lights from single place.

You do not need name of component they need to effect, you can get “all components of class” for your parent.
I am doing exactly this with my light manager component.

But indeed it is sad that we cannot “bind” any other components to custom bp component.
It would be great if i could for eg. just drop 3 thrusters with my component then do 6dof movement without adding code to parent blueprint.