How to create array from Static Mesh actors in a blueprint?

I have like alot of actors within this blueprint an many other that i need to change materials to. Previously i would connect each one in the target point however im fed up with it and tried to create an array but with no success. Can someone tell me of a better way to do this?

You can use the method in the first pic, just run the output through For Each loop - this will iterate through every element in the array Get All Actors Of Class spits out. That’s for actors.

For components:

You manually add them to an array using Make Array node. Create a variable of the desired type and turn it into an array - looping with For Each node will give the iterations. You need to do it only once but you can have more than one array. You can have the same object reference stored in more than one array if needed.

Yet another way is to use tags, Get Components By Tag node returns a filtered array.

If you need something more complex (run-time only, though) use a collider and Get Overlapping Components. → For Each.

It still gets the job done on only one of the meshes present within this blueprint!

Read the rest of what I said. :slight_smile: You need to group the components in the Kitchen BP - you only need For Each there if you have more than kitchen.

edit:

Do something like that in the Kitchen:

248617-capture.png

And then call the Custom Event

Is there a way to connect all these static meshes at once? That was the initial request. Otherwise if i do it i again like this it will still take me alot of time. If there is no shortcut to connect them instantly than manual jobs it is than! :frowning:

Yes, use tags.

You can click+shiftClick to get a list of components and give them tags. And then GetComponentsByTag.

edit: something like that

This way you do not need to store anything in the array. But that’s up to you.

Now we are cooking :slight_smile: Thanks for taking up with my silly questions :slight_smile:

No problem. Good luck.