Is there a way to add initial components in a static mesh component array?

Hello,
I have an array and I have a lot of components in my blueprint. So I need to add them into that array, preferably right in the beggining. So I do what you see on the image, but I know there is a plus button and it doesn’t allow me to choose components from the blueprint, it allows me only to choose an actor from a content browser. Can you help me add my componets in a more efficient way?
Thank you in advance.

Hey Naiuma!

You can use the GetComponentsByClass node for this, and then use a ForEach node of those, add them to the array!

Now, if you have multiple TYPES of component you want to add, you’ll have another of these.

But if they’re all boxes, you can indeed use that single node plus a ForEach->Add and shorten it down to 4 nodes:

Your input Actor
GetComponentsByClass with whatever the box component is as the component class
ForEach
Add

:slight_smile:

Let us know if you have anymore issues!

image

Hello @ClockworkOcean and @Mind-Brain
Thank you very much. It almost solves my issue. I would only prefere By Tag than by class because I have boxes which have to be amended in different time. Thank you for the tip :slight_smile:

There is a by tag, also…

1 Like