How can i add multiple static meshes to some sort of group or node in the blueprint? Im essentially making a configurator in Unreal, and i need to be able to turn on and off lots of meshes with the press of a key.
Below you can see an example of a blueprint i have made which changes the material on a single mesh. I have another similar blueprint working which switches a single meshes visibility in game. The problem is i cant figure out how to use multiple assets/meshes together and in 1 blueprint.
I’ve looked into using a static mesh Array, but again im really struggling with how to use that with my visibility or material node. The array looks like i can add as many meshes to it as needed which is good, but i honestly am lost with what node comes after the Array in the BP editor.
When i make a new array in the “variables” section on the left of the BP editor, i kinda get the set up process for the array, but when i then drag that into the event graph editor, i cant attach it to a SetVisibility or SetMaterial node.
Would you be able to show an example of this if possible? It would be greatly appreciated!
Umm I’m not in front of the computer atm but could you drag off the array and do a foreach node and then drag off the array element I think it’s called and do a setvisibility or setmaterial node from that
This appears to work with the “static mesh component” array type but not the “static mesh” array type. I might be in over my head here but I hope it works
Hi :). It was 2am when i responded last night, I have had a bit of time and I have reproduced the behaviour I think you are looking for and have a better explanation.
I have made a blueprint with 3 static meshes, 2 chairs and a table, and I will use a key to toggle the chair visibility. Hopefully this simulates what you are trying to achieve.
First step is to create a blueprint and add the static meshes that you want.
Second step is to create an array of type “Static mesh component”
Make sure you turn the variable into an array with the little grid icon like so:
Then you must enable input into the blueprint and add the static meshes into the array:
Just a quick question. Should i be making this in the “Level Blueprint”? or should i make a new “blueprint actor”?
In the “Array” where it says “default value” am i suppose to add all my mesh elements in here? or am i just adding them in the “component” tab at the top left?
If so, its looking like i might have 50+ meshes i want to turn on or off and this would be very time consuming to do. I thought the array would get around this issue by allowing me to add everything in each array i need? Or am i totally mistaken haha
By the way, the screenshots you’ve posted are really helpful!
I made a blueprint actor and added the static meshes in the components tab. I am not sure how to add them as default values, it seems like something you should be able to do but i can’t figure out how atm. I have added array elements to the default values and it has an area to add meshes, but there is nothing in the drop down list which seems strange.
I don’t really know how to do this, I will have a look on google and see if there is a way to do it
this way there is no need to create and populate an array, just give all the components a tag and use that get component by tag node, and it will affect all components with that tag
Thanks again for the info! I’ve built the blueprint based of your screenshots and things seem to work which is good news. Im currently looking into scaling this up without it being extremely tedious haha. I’ll let you know of my progress!
Yes it works!!! Thank you so much for all the help!
If i can one more question for you, is it possible to use a multigate node, or something similar so i can cycle through 3 different objects for example? Currently im using a keyboard “Z” input as im aiming to cycle/loop through meshes.