Procedural Randomization

OK I know what I was doing wrong. I made a Variable called static mesh instead of making a component static mesh.

I deleted the variable static mesh and created a component static mesh and it works as it should.

I have about 7 meshes so I am using a static mesh variable set to an array to give me the random ability to drag and drop building in.

Makes sense. So is it working the way you need it to?

Yes, thank you for your help. Its doing what I though it would do.
Let me ask another question. Lets say I have 3 different materials for each building. IE For buidling A has 3 materials. One shows the building color gray, one is red and one is brick. How would I get those material to show up randomly when I am dragging out or coping this blueprint.

So right now it works everytime I move or copy the bp it randomly creates one of the 7 buildings but they ( A,B,C,D,E,F ) always have the same material on.

I hope that makes sense, lol

The most straightforward method would be quite similar to what you’re doing with the meshes. Something along the lines of:

You can fetch materials from an array or even from a Select node. There are better, more sophisticated and convoluted ways but that’s the gist.

OK great. I can play around with that. I was thinking maybe it could be done in the material itself? PerinstanceRandom?

Sure, a dynamic material would work well:


You could feed DMI (Dynamic Material Instance) a texture param. Colour would be a vector parameter.

There’s probably a dozen ways to organise it. Here’s an example with Custom Primitive Data, if colours is all you need, this is crazy efficient:

Although you’ll probably find better examples on YT.

So I am back on this today. I set up the BP correctly, I think.
My Select has 3 different texture maps set for 3 options. The create dynamic material instance Function has the parent set to a material that has one texture map set for the base color. I defined the static mesh with one of my buildings and the same material that is in the create dynamic material instance function.

I am a little lost on what is supposed to happen now? It doesn’t seem to be working.