So I’m trying to create randomly-generated buildings from modular sections and I’m having trouble randomizing each instance. Essentially, I want each instanced static mesh I create to be a randomly generated mesh, but I can’t seem to find any information on how to do that in blueprints. Any and all suggestions are much appreciated!
Hi,
Probably the simplest way would be to create an array of static meshes then choose one from random:
Another way, a bit more complex but makes it easy to expand to more than just houses (eg fences, garages, pathways etc) is to use DataAssets and have arrays in those for different types.
Thanks for replying! I’ve already got that far but I can’t figure out how to make each instance a different random mesh. With that, it randomly gets 1 mesh and sets all instances to that.
I see - you need to create a unique ISMC/HIMC for each type and create instances from them - you can create a Map of StaticMeshes->ISMC/HISMC to find the correct one when choosing a random mesh…
That sounds perfect! How would I go about that?
Use that blueprint, but call it in the Construction script.
Assign the randomly selected mesh to the static mesh component mesh property.
This will make each instance have a random mesh.
That worked like a charm thanks!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.