Download

Array of static meshes

I created this construction script blueprint to have a fence spawned with the amount that is set.

It works perfectly fine.

Now I want to turn it into a construction script, where I can select any mesh and make it behave the same way. The problem is I don’t know how to use a custom mesh instead of the one from the components screen as there are compability problems between the staticmesh and staticmeshcomponent objects. A short solution would be much appreciated! :slight_smile:

Add a StaticMesh variable to your BP (not a StaticMeshComponent variable!), and make it editable (click the little eye icon next to the variable). Then in your Construction Script add a ‘Set Mesh’ node on the component that is returned from the ‘Add Static Mesh’ node, passing in the value of the StaticMesh variable.

Is it possible to do something similar but with an array of Blueprints, from within the construction graph? Or do you have to do a workaround so you only have preview meshes in the construction graph, and then they translate into real blueprints via the event graph?

You can certainly use the value of exposed variables (float, meshes etc) in the Construction Script, that is very much the intention :slight_smile:

Thank you JamesG! I expanded the script a bit and this is what I got:
https://youtube.com/watch?v=Ff6Rj62aXq8

http://i.imgur.com/G6nbPnD.jpg

Sorry for the mess! :smiley:

Too bad I can’t share this blueprint … yet.