# Dynamic spawning actor blueprint

**URL:** <https://forums.unrealengine.com/t/dynamic-spawning-actor-blueprint/458752>\
**Category:** Blueprint\
**Tags:** spawn, actor, details-panel-ui, unreal-engine, dynamic, Blueprint, question\
**Created:** [November 23, 2019, 6:25pm UTC](https://forums.unrealengine.com/t/dynamic-spawning-actor-blueprint/458752 "2019-11-23T18:25:30Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![VinSash](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vinsash/32/574812_2.png) [@VinSash](https://forums.unrealengine.com/u/VinSash)\
**Post date:** [November 23, 2019, 6:25pm UTC](https://forums.unrealengine.com/t/dynamic-spawning-actor-blueprint/458752/1 "2019-11-23T18:25:30Z")

</div>

Hey guys,  
I’m trying to create something that seems to be too difficult for me and so I’m looking for your precious help 🙂  
I’ll try to be clear on the description of what I want but it is not easy to explain.  
So, what I try to do is to create a blueprint actor that will spawn a user selected amount of cubes side by side and with a selectable length of each cube. The way I would like to select the amount of cubes is by using something like a + sign in the blueprint details panel and, every time that + sign is clicked it spawn a cube and a new variable in the details panel for selecting its size. These Photoshop’d image may be more easy to understand what I’m trying to achieve…

 ![292885-capture1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/2/b/e2b2ff392066ac65d9c1b595c8cc36b2e89b442e.jpeg)

 ![292886-capture2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/5/c/d5c083c0d85e58cec51eaee563da0358cc14ffcb.jpeg)

Is that possible using only blueprints?

Thanks a lot in advance for your help !

---

<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:** [November 23, 2019, 9:05pm UTC](https://forums.unrealengine.com/t/dynamic-spawning-actor-blueprint/458752/2 "2019-11-23T21:05:01Z")

</div>

Easy to do mate. Make a new custom event in your BP and ( with it selected ) tick the ‘call in editor’ box in the details panel.

This way, you can get your plus sign for new cubes and the size buttons you’re talking about… ( or very similar functionality ).

---

<div class="post-metadata">

**Author:** ![VinSash](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vinsash/32/574812_2.png) [@VinSash](https://forums.unrealengine.com/u/VinSash)\
**Post date:** [November 23, 2019, 10:20pm UTC](https://forums.unrealengine.com/t/dynamic-spawning-actor-blueprint/458752/3 "2019-11-23T22:20:13Z")

</div>

Nice, that seems to be easy indeed 🙂  
I’ll not have a chance to test that before Monday though but I’m pretty sure you saved my day 🙂  
Thank you so much

---

<div class="post-metadata">

**Author:** ![ThompsonN13](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ThompsonN13](https://forums.unrealengine.com/u/ThompsonN13)\
**Post date:** [November 23, 2019, 11:28pm UTC](https://forums.unrealengine.com/t/dynamic-spawning-actor-blueprint/458752/4 "2019-11-23T23:28:06Z")

</div>

i think it may be a bit more complex than your thinking.

to have a setup like what the OP has in the picture you would need to use something like a map (mesh(mesh), size(float)). I don’t believe maps use indexes do they so you would lose track of the order. If you wanted to use an array then you would have to decide on one variable type. that leads me to thinking a struct for each array index, that way you can store the mesh and the size in one index. from there you would just need to have a script to update the locations of the cubes whenever the size value is changed.

i noticed one other potential issue whilst testing, when i tried to do this using add static mesh component the components would be destroyed if the actor was moved or if a variable changed (changed size variable). now this may be due to something i’m overlooking or maybe the engine version i’m using (4.17) but i figured i’d note it.

---

<div class="post-metadata">

**Author:** ![VinSash](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vinsash/32/574812_2.png) [@VinSash](https://forums.unrealengine.com/u/VinSash)\
**Post date:** [November 24, 2019, 3:25pm UTC](https://forums.unrealengine.com/t/dynamic-spawning-actor-blueprint/458752/5 "2019-11-24T15:25:33Z")

</div>

Good point… Besides that I just realized I can’t use Custom Event from the Construction Script which is annoying because using that method I’ll have to in play mode to see the result. I would have preferred to see the final result in Editor mode, so using Construction Script.

---

<div class="post-metadata">

**Author:** ![ThompsonN13](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ThompsonN13](https://forums.unrealengine.com/u/ThompsonN13)\
**Post date:** [November 24, 2019, 7:41pm UTC](https://forums.unrealengine.com/t/dynamic-spawning-actor-blueprint/458752/6 "2019-11-24T19:41:43Z")

</div>

you can actually run custom events from the construction script. just create them in the event graph then call them from the construction script. also though you can create custom events and run them directly in the level editor like clockwork mentioned. to do this create a custom event, then with the event selected go to the details panel and check the box for call in editor, then place the actor in the level, with the actor selected you will find a button to run your event in the details panel.

---

<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:** [November 24, 2019, 8:59pm UTC](https://forums.unrealengine.com/t/dynamic-spawning-actor-blueprint/458752/7 "2019-11-24T20:59:55Z")

</div>

Or, you could just get this:

> **[Mesh & Actor Placement 7.3 in Blueprints - UE Marketplace](https://www.unrealengine.com/marketplace/en-US/product/builder)**
>
> Use the Blueprints to make stairs, columns, bridges, buildings, pipes, cables and many more.

---

<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:** [November 24, 2019, 9:01pm UTC](https://forums.unrealengine.com/t/dynamic-spawning-actor-blueprint/458752/8 "2019-11-24T21:01:13Z")

</div>

I think it might be easier if all the cubes are inside on BP?..

( I could be ‘under-thinking’ it… )

---

<div class="post-metadata">

**Author:** ![VinSash](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vinsash/32/574812_2.png) [@VinSash](https://forums.unrealengine.com/u/VinSash)\
**Post date:** [November 27, 2019, 9:41am UTC](https://forums.unrealengine.com/t/dynamic-spawning-actor-blueprint/458752/9 "2019-11-27T09:41:40Z")

</div>

Thanks for the suggestion. I already own this asset but there are too many things in there I do not need and I want to keep my project as clean as I can so create my own stuff is better and will also increase my knowledge 🙂 Full benefit 😉

---

<div class="post-metadata">

**Author:** ![VinSash](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vinsash/32/574812_2.png) [@VinSash](https://forums.unrealengine.com/u/VinSash)\
**Post date:** [November 27, 2019, 9:43am UTC](https://forums.unrealengine.com/t/dynamic-spawning-actor-blueprint/458752/10 "2019-11-27T09:43:20Z")

</div>

I’m doing some good progress thanks to your help. Thank you very much for that again.  
Quick other question, the calling button for the Custom Event appears in my Actor’s “Default” category. Is there a way to change the category as we can do for variables? Pure cosmetic 🙂

---

<div class="post-metadata">

**Author:** ![ThompsonN13](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ThompsonN13](https://forums.unrealengine.com/u/ThompsonN13)\
**Post date:** [November 27, 2019, 3:20pm UTC](https://forums.unrealengine.com/t/dynamic-spawning-actor-blueprint/458752/11 "2019-11-27T15:20:12Z")

</div>

im not really sure as ive never tried to add one to a category before. I took a quick look to see if its possible but didn’t see any way to do it.
