# Procedural Randomization

**URL:** <https://forums.unrealengine.com/t/procedural-randomization/230071>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [May 19, 2021, 1:43pm UTC](https://forums.unrealengine.com/t/procedural-randomization/230071 "2021-05-19T13:43:57Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![werx60](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@werx60](https://forums.unrealengine.com/u/werx60)\
**Post date:** [May 19, 2021, 1:43pm UTC](https://forums.unrealengine.com/t/procedural-randomization/230071/1 "2021-05-19T13:43:57Z")

</div>

Hi all,

I am new to BP and I am looking for some advice on how to create some procedural meshes. I have successfully created the first part. I have imported 6 buildings ( as one mesh not 6 individual meshes) and I have created a BP to generate it on the X,Y. As you can see it looks very repetitive.

How would I go about making something that would shuffle the order of the meshes? Is that possible?

Any help would be appreciated.

Thanks  
Alex

 ![2021-05-19 09_13_50-Starter - Unreal Editor](https://d3kjluh73b9h9o.cloudfront.net/original/3X/f/b/fbf640a525a90bcb5369d88092f0395ca662d9cd.png) ![2021-05-19 09_15_14-Starter - Unreal Editor](https://d3kjluh73b9h9o.cloudfront.net/original/3X/e/2/e240eba47588edc7b68d760207a6790c2aaacf28.png)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 19, 2021, 2:18pm UTC](https://forums.unrealengine.com/t/procedural-randomization/230071/2 "2021-05-19T14:18:51Z")

</div>

By far the easiest way is to re-import as separate meshes, then the blueprint is easy…

---

<div class="post-metadata">

**Author:** ![werx60](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@werx60](https://forums.unrealengine.com/u/werx60)\
**Post date:** [May 19, 2021, 7:17pm UTC](https://forums.unrealengine.com/t/procedural-randomization/230071/3 "2021-05-19T19:17:44Z")

</div>

Yes I have come to the conclusion that’s a better way to approach it. Although I still cant figure out how to do it.

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [May 19, 2021, 9:36pm UTC](https://forums.unrealengine.com/t/procedural-randomization/230071/4 "2021-05-19T21:36:42Z")

</div>

Each mesh as it’s own BP. Procedural Bldg BP would randomly select a bldg bp from a list and spawn it. Use the bounds of the first mesh as a location guide.

A more complex approach would be to have each Bldg BP use an HISM component. Then instead of spawning BP’s you’d add an HISM instance to the match bldg bp. You’d need an extensive config for this.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 20, 2021, 10:06am UTC](https://forums.unrealengine.com/t/procedural-randomization/230071/5 "2021-05-20T10:06:03Z")

</div>

Only one BP, which will randomly decide which mesh to spawn.

---

<div class="post-metadata">

**Author:** ![werx60](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@werx60](https://forums.unrealengine.com/u/werx60)\
**Post date:** [May 20, 2021, 1:01pm UTC](https://forums.unrealengine.com/t/procedural-randomization/230071/6 "2021-05-20T13:01:27Z")

</div>

Thanks guys. I need to do some research into your suggestions. Being that I have never used BP before its a bit overwhelming right now.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 20, 2021, 1:11pm UTC](https://forums.unrealengine.com/t/procedural-randomization/230071/7 "2021-05-20T13:11:01Z")

</div>

Just get the meshes read in separately, I’ll show you a bit of BP to use…

---

<div class="post-metadata">

**Author:** ![werx60](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@werx60](https://forums.unrealengine.com/u/werx60)\
**Post date:** [May 20, 2021, 1:12pm UTC](https://forums.unrealengine.com/t/procedural-randomization/230071/8 "2021-05-20T13:12:57Z")

</div>

appreciate that. I do have the meshes imported separately now.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 20, 2021, 1:18pm UTC](https://forums.unrealengine.com/t/procedural-randomization/230071/9 "2021-05-20T13:18:39Z")

</div>

Right. Make an actor BP, one variable, which is an array of type static mesh. Also give the BP a static mesh component, like this:

 ![Screenshot_10](https://d3kjluh73b9h9o.cloudfront.net/original/3X/8/6/86ad6845803b18b45ef832fc61a0455c9b799f35.png)

In the construction script:

 ![Screenshot_11](https://d3kjluh73b9h9o.cloudfront.net/original/3X/0/2/02a928ce12717af4ff6d301fe826906507b1aeae.png)

That’s it!

![random mesh](https://d3kjluh73b9h9o.cloudfront.net/original/3X/c/c/cc4ba641496cc4468f05a91c0b8176dd15659663.gif)

---

<div class="post-metadata">

**Author:** ![werx60](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@werx60](https://forums.unrealengine.com/u/werx60)\
**Post date:** [May 20, 2021, 1:22pm UTC](https://forums.unrealengine.com/t/procedural-randomization/230071/10 "2021-05-20T13:22:22Z")

</div>

Hmm seems doable. Let me ask in the static mesh is that where I would define the number of buidlings…A,b,C etc?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 20, 2021, 1:23pm UTC](https://forums.unrealengine.com/t/procedural-randomization/230071/11 "2021-05-20T13:23:46Z")

</div>

Like this:

 ![Screenshot_13](https://d3kjluh73b9h9o.cloudfront.net/original/3X/b/4/b4e051fc0b20163e5c820e7bc16b6e2e475a007f.png)

you can also put this on the end of the script to get random Z angle ( in 90s )

 ![Screenshot_12](https://d3kjluh73b9h9o.cloudfront.net/original/3X/9/6/96a3d206cc63dbaac1a29bcdfbc3b5bcd5833bc9.png)

---

<div class="post-metadata">

**Author:** ![werx60](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@werx60](https://forums.unrealengine.com/u/werx60)\
**Post date:** [May 20, 2021, 1:25pm UTC](https://forums.unrealengine.com/t/procedural-randomization/230071/12 "2021-05-20T13:25:54Z")

</div>

awesome. Thank you! I will work on this later this afternoon. Will let you know how it goes.

Alex

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [May 20, 2021, 7:00pm UTC](https://forums.unrealengine.com/t/procedural-randomization/230071/13 "2021-05-20T19:00:18Z")

</div>

I was looking at each bldg as a prefab vs a single static mesh.

---

<div class="post-metadata">

**Author:** ![werx60](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@werx60](https://forums.unrealengine.com/u/werx60)\
**Post date:** [May 25, 2021, 3:57pm UTC](https://forums.unrealengine.com/t/procedural-randomization/230071/14 "2021-05-25T15:57:19Z")

</div>

why cant I find the Set static Mesh function?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 25, 2021, 4:02pm UTC](https://forums.unrealengine.com/t/procedural-randomization/230071/15 "2021-05-25T16:02:11Z")

</div>

Drag & drop Static Mesh Component reference into the graph (from the Components panel) , drag a wire and search for what you need.

Nodes are context sensitive, while what you ask should still pop up in a regular search, not everything does.

---

<div class="post-metadata">

**Author:** ![werx60](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@werx60](https://forums.unrealengine.com/u/werx60)\
**Post date:** [May 25, 2021, 4:19pm UTC](https://forums.unrealengine.com/t/procedural-randomization/230071/16 "2021-05-25T16:19:45Z")

</div>

I actually did that but its not giving me the same thing.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 25, 2021, 4:20pm UTC](https://forums.unrealengine.com/t/procedural-randomization/230071/17 "2021-05-25T16:20:56Z")

</div>

You mean this:

Or what are we doing?

---

<div class="post-metadata">

**Author:** ![werx60](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@werx60](https://forums.unrealengine.com/u/werx60)\
**Post date:** [May 25, 2021, 4:35pm UTC](https://forums.unrealengine.com/t/procedural-randomization/230071/18 "2021-05-25T16:35:30Z")

</div>

I am dragging the static Mesh variable that I made. I do not have a static mesh where you are grabbing from. Should I?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 25, 2021, 4:36pm UTC](https://forums.unrealengine.com/t/procedural-randomization/230071/19 "2021-05-25T16:36:00Z")

</div>

> [@werx60](#):
>
> I do not have a static mesh where you are grabbing from. Should I?

Could you show a screenshot of what you’re doing? There should be no need to manually create variables. But if you created a variable to reference a static mesh, you can set it directly in the details panels:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/7/7/77481637e35e41f9beb4a561058f3a9a934285d8.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 25, 2021, 4:36pm UTC](https://forums.unrealengine.com/t/procedural-randomization/230071/20 "2021-05-25T16:36:45Z")

</div>

Also, since we’re talking about random grid gen, consider taking this 2D Grid Execution node for a spin at some point:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/8/b/8b1accb18826ea22686e392f8e2859399b8c5c51.jpeg)

[Next page](https://forums.unrealengine.com/t/procedural-randomization/230071.md?page=2)
