Instanced static mesh from changeable variable

So I watched this video:
A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums10-_Using_Loops:_Procedural_Level_Design

Which details how to do what I want to do, but it uses static meshes set inside the blueprint. I’m trying to figure out how to do it with instanced static meshes for the performance gains.

One of the issues i’m having is that I want to assign the mesh to a variable so that I can have a generic “procedural instanced mesh” blueprint that I can set the mesh for from the editor (using an exposed variable) and have it work with any mesh without having to alter the blueprint. Is this the proper way to go about it? I couldn’t figure out how to set an instanced mesh to an exposed variable that I can change from the editor view. Is this even possible?

Thanks for any help ahead of time.

EDIT: I already have a function that I made to get the size of the mesh dynamically, so that’s not an issue.

You’ll want to approach this a bit differently to how Zak set it up in that video. Start with an Instanced Static Mesh as your main component. Then, in the Construction Script, use SetStaticMesh to assign the mesh you want to use from your variable (type:StaticMesh). Then in you ForLoop, use AddInstance to increase the number of mesh instances.

Don’t forget to dynamically adjust the number of meshes and spacing based on the mesh size (circled areas), but it sounds like you’ve go that worked out already.

Thank you so much for your help; this worked perfectly.