# Pyramid Construction Using Blueprints

**URL:** <https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [September 17, 2020, 10:57pm UTC](https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514 "2020-09-17T22:57:17Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_026841cd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_026841cd](https://forums.unrealengine.com/u/anonymous_user_026841cd)\
**Post date:** [September 17, 2020, 10:57pm UTC](https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514/1 "2020-09-17T22:57:17Z")

</div>

Hi All

I have been trying to follow some tutorials on arranging an instance cube procedurally using blueprints.  
So far I have only managed to create the bottom 9x9 grid and I’m getting lost with how to construct the other tiers of the pyramid.  
I am new to using the blueprints and I am trying to replicate the attached image made in Blender.

Does anyone have any ideas on how to create the other tiers. 7x7\_5x5\_3x3\_1

Eventually I would like to be able to create the pyramid using seeds and for it to be missing cubes in places like in the Blender Image.

Thanks

 ![314095-capture-04.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/a/0/9a0bdb8ee219950b445692a1d62cf4d1d490d954.jpeg)

---

<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:** [September 18, 2020, 7:59am UTC](https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514/2 "2020-09-18T07:59:44Z")

</div>

Like this:

 ![314110-pyramid.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/d/c/ddc9bb75621a89b02f0033181eaab0522fa32e90.jpeg)

![314117-pyramid.gif](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/3/3/e33a180b32de0f6e23e5d185381bb4fcd3246925.gif)

Code also attached.

link text][3]

---

<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:** [September 18, 2020, 8:03am UTC](https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514/3 "2020-09-18T08:03:59Z")

</div>

Here’s my take on it:

 ![314116-screenshot-2020-09-18-085931.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/f/1/9f19612db69f3ab7da424e392e724dcbc460067c.jpeg)

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/a/0/6a0965ae7314a8eb9ac9e698cd584bada67eb686.gif)](https://gyazo.com/6882bbdf92d16022eebbb11290fa20e9)

The weighted bool allows you to skip blocks.

---

<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:** [September 18, 2020, 8:05am UTC](https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514/4 "2020-09-18T08:05:36Z")

</div>

Unlike ClockworkOcean’s, mine does not build the tip ☹

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_026841cd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_026841cd](https://forums.unrealengine.com/u/anonymous_user_026841cd)\
**Post date:** [September 18, 2020, 8:59pm UTC](https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514/5 "2020-09-18T20:59:52Z")

</div>

These are both fantastic answers. Thanks Guys.  
I don’t know which method will be best yet  
Ive decided to first test @ClockworkOcean to see if I can replicate and expand on what I’m trying to achieve.

How did you get the location node inputs onto the “Add static mesh component”?

![314195-clockworkocean-capture.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/a/3/ea3f1b139094e7a204de7c7b1f424a01b4886f88.jpeg)

 ![314218-pyramid.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/c/0/9c04e1646da2517b808985acfbe8010a91a0f102.jpeg)

The end result I’m trying to achieve would hopefully look as pictured above.  
I already have the Pink cube as a destructible mesh and the glass cube as a blueprint (this changes material when the character collides with it).  
These are the blocks I would like to spawn at random around the blue center core of the Pyramid.

The Blue core will not move or destruct at all. Just fine as static cubes. Can I remove blocks from the spawning Pyramid to allow room for the blue static blocks?

Thanks for your help.  
Sorry if this is getting really deep.

---

<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:** [September 18, 2020, 9:03pm UTC](https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514/6 "2020-09-18T21:03:52Z")

</div>

Just right click on the transform pin and choose ‘split pin’, then do it again on the location pin.

You’ll notice I chose to spawn depending on a random number. You can decide what kind of cube to spawn depending on your X and Y parameters.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_026841cd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_026841cd](https://forums.unrealengine.com/u/anonymous_user_026841cd)\
**Post date:** [September 18, 2020, 11:21pm UTC](https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514/7 "2020-09-18T23:21:07Z")

</div>

So I have been trying to decipher what you constructed. The ‘random float’ numbers I now know effect the construction although I’m not sure about the ‘\>’ tab above them.

When you say about deciding which cube to spawn depending on the X + Y parameters. I can only guess something has to happen where the green wires are?

The only way I have gotten a different cube in so far is like the image below. Although that fills all the gaps back in again 😕

 ![314199-capture-05.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/e/d/ceda3db9aa8c50bb209052665791847c440cba57.jpeg)

---

<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:** [September 19, 2020, 12:58pm UTC](https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514/8 "2020-09-19T12:58:22Z")

</div>

The randdom node generates numbers between 0 and 1. I’m saying if that number is \> than .25, make then cube. In other words cubes have a 75% chance of begin drawn.

You can say, if the random number is between 0 and .3 ( for instance ), then spawn a glass cube, otherwise spawn a normal one.

Or you could split the 0-1 range into 3 and draw 3 different types of cube.

---

<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:** [September 19, 2020, 12:59pm UTC](https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514/9 "2020-09-19T12:59:05Z")

</div>

Yes, your problem here is that you’re always spawning a cube. You need to break the range into 3 parts and make a decision.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_026841cd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_026841cd](https://forums.unrealengine.com/u/anonymous_user_026841cd)\
**Post date:** [September 19, 2020, 6:14pm UTC](https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514/10 "2020-09-19T18:14:44Z")

</div>

I understand what you are saying, however in practice I still have trouble with the node setups.  
Are you ok to scribble some notes onto my screen capture? I don’t know where to be adding and connecting things.

Thanks

---

<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:** [September 19, 2020, 6:49pm UTC](https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514/11 "2020-09-19T18:49:51Z")

</div>

So I redid it a bit. Used a random int instead of float, easier to pick from an array. The array looks like this:

 ![314297-meshes.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/b/4/4b46671f02bc0868391217a2c9e28d718c2c1b50.jpeg)

The difference in BP is:

 ![314298-bp-diff.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/8/5/38502e9dc3f1a2a71b6cbc122fcd72a4050e5041.jpeg)

Result:

 ![314299-variations.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/5/2/352fc2f29ebd77bcf418395f3e669a4fa127425c.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_026841cd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_026841cd](https://forums.unrealengine.com/u/anonymous_user_026841cd)\
**Post date:** [September 19, 2020, 10:57pm UTC](https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514/12 "2020-09-19T22:57:50Z")

</div>

That looks great although I would only want around 5-10% of the glass blocks. I have tried to use your technique to limit the amount of glass blocks.  
Pretty sure I haven’t gone about it the best way but I have attached an image to show my working.

 ![314320-block-game-screenshot-02.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/9/0/090163d59a761f4b04b53ea7b1ed1050a7cdcdf1.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_026841cd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_026841cd](https://forums.unrealengine.com/u/anonymous_user_026841cd)\
**Post date:** [September 19, 2020, 11:05pm UTC](https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514/13 "2020-09-19T23:05:13Z")

</div>

There are just the 2 types of blocks that make up the Pyramid. I tried to insert them into the mesh variable but it wouldn’t take either of the blocks.

![314342-block-game.gif](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/2/7/d27a89a162879718c65b2942b02824196481894d.gif)

---

<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:** [September 20, 2020, 12:11am UTC](https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514/14 "2020-09-20T00:11:44Z")

</div>

You could try it like so:

 ![314349-screenshot-2020-09-20-030042.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/6/6/c66b29944fefc0f0409e3e9f8bd071eceeab90f5.jpeg)

---

<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:** [September 20, 2020, 7:50am UTC](https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514/15 "2020-09-20T07:50:03Z")

</div>

That looks good, 1/12 chance of being glass.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_026841cd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_026841cd](https://forums.unrealengine.com/u/anonymous_user_026841cd)\
**Post date:** [September 22, 2020, 4:17pm UTC](https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514/16 "2020-09-22T16:17:32Z")

</div>

That has worked really well!  
Instead of a basic block in the 90% chance of spawn I’ve been trying to use a destructible mesh I created. Although It doesnt want to be connected to the ‘Select’ tab.

I did try converting the ‘False’ to a number of destructible variables but I still had no luck.

 ![314583-capture-06.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/9/4/29401770943a192b53fb41af796ef440f996b52d.jpeg)

---

<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:** [September 22, 2020, 4:34pm UTC](https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514/17 "2020-09-22T16:34:49Z")

</div>

We can’t have a Static Mesh Component & Destructible Mesh Component in the select node, you’d need to Branch it like so:

 ![314585-destr.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/6/0/960cdd337edfb3029e0ee65699612cb9ff3ab812.jpeg)

The other Select nodes are optional unless you need multiple static / destructible meshes, ofc.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_026841cd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_026841cd](https://forums.unrealengine.com/u/anonymous_user_026841cd)\
**Post date:** [September 22, 2020, 5:48pm UTC](https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514/18 "2020-09-22T17:48:32Z")

</div>

Is there a way I can make them independent of each other? Would an instance work?  
They all seem to crumble at once.  
Thanks

![314591-destructable-mesh.gif](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/3/2/732bb2c62e57b60cd9c01dab1cc062e9f55a5234.gif)

---

<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:** [September 22, 2020, 6:00pm UTC](https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514/19 "2020-09-22T18:00:59Z")

</div>

They are independent. How are you applying damage?

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/7/3/973b9bd70157b38e7b6109acc11ab703b795a6af.gif)](https://gyazo.com/9b9a2fe7783503ec1345f2f1529f5829)

 ![314578-screenshot-2020-09-22-211404.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/d/3/3d3ff9872efbb74ec00ed59e00acf566692429b4.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_026841cd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_026841cd](https://forums.unrealengine.com/u/anonymous_user_026841cd)\
**Post date:** [September 23, 2020, 12:51am UTC](https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514/20 "2020-09-23T00:51:53Z")

</div>

I found what the problem was. I had ‘enable impact’ ticked in the destructible mesh settings.

[Next page](https://forums.unrealengine.com/t/pyramid-construction-using-blueprints/471514.md?page=2)
