# How to create meshes in construction script from folder in BP?

**URL:** <https://forums.unrealengine.com/t/how-to-create-meshes-in-construction-script-from-folder-in-bp/290695>\
**Category:** Blueprint\
**Tags:** unreal-engine, construction-script, meshes, Blueprint, question\
**Created:** [August 11, 2014, 3:17pm UTC](https://forums.unrealengine.com/t/how-to-create-meshes-in-construction-script-from-folder-in-bp/290695 "2014-08-11T15:17:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shelby](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shelby](https://forums.unrealengine.com/u/Shelby)\
**Post date:** [August 11, 2014, 3:17pm UTC](https://forums.unrealengine.com/t/how-to-create-meshes-in-construction-script-from-folder-in-bp/290695/1 "2014-08-11T15:17:40Z")

</div>

Hello,

How can I add, within the construction script, a mesh that I could find from a folder?

For example, I want to add this mesh in my construction script:  
/Game/Props/Object001

How can I do that?

Thank you!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_759e5c3a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_759e5c3a](https://forums.unrealengine.com/u/anonymous_user_759e5c3a)\
**Post date:** [August 11, 2014, 3:24pm UTC](https://forums.unrealengine.com/t/how-to-create-meshes-in-construction-script-from-folder-in-bp/290695/2 "2014-08-11T15:24:25Z")

</div>

Hi Shelby,

You will want to use a “Add Static Mesh Component” node. There will be a dropdown option on the node that will allow you to pick a static mesh from your content browser. Let me know if that helps.

Cheers,

---

<div class="post-metadata">

**Author:** ![Shelby](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shelby](https://forums.unrealengine.com/u/Shelby)\
**Post date:** [August 11, 2014, 3:37pm UTC](https://forums.unrealengine.com/t/how-to-create-meshes-in-construction-script-from-folder-in-bp/290695/3 "2014-08-11T15:37:33Z")

</div>

Thank you for your answer,

I have a string variable storing the path of the mesh I want to spawn.  
The variable can contain more than 50 different paths so doing a switch on all these values won’t be really efficient…

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_759e5c3a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_759e5c3a](https://forums.unrealengine.com/u/anonymous_user_759e5c3a)\
**Post date:** [August 11, 2014, 5:27pm UTC](https://forums.unrealengine.com/t/how-to-create-meshes-in-construction-script-from-folder-in-bp/290695/4 "2014-08-11T17:27:30Z")

</div>

Could you explain more about what you are trying to accomplish? Using a String to determine a path for an object is not a default function in Blueprints. You could code a custom node to do that though. There are many ways to swap 50 or more meshes, but that all depends on how you would like it to function.

Are the meshes something procedural and random, or would a level designer just need an easy way to swap between them? Can you give an example of something similar?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5de2a6ae1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5de2a6ae1](https://forums.unrealengine.com/u/anonymous_user_5de2a6ae1)\
**Post date:** [May 2, 2016, 4:27pm UTC](https://forums.unrealengine.com/t/how-to-create-meshes-in-construction-script-from-folder-in-bp/290695/5 "2016-05-02T16:27:28Z")

</div>

Does the construction script erase all created components when refiring or do I have to do that manually?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e05ec13d1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e05ec13d1](https://forums.unrealengine.com/u/anonymous_user_e05ec13d1)\
**Post date:** [October 1, 2017, 7:14pm UTC](https://forums.unrealengine.com/t/how-to-create-meshes-in-construction-script-from-folder-in-bp/290695/6 "2017-10-01T19:14:28Z")

</div>

Yes it does.  
From my own testing, `GetNumChildrenComponents` on the root component return 0 (i.e. all created components are erased) every time I compile the blueprint.

---

<div class="post-metadata">

**Author:** ![Havard\_stardust](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Havard\_stardust](https://forums.unrealengine.com/u/Havard_stardust)\
**Post date:** [January 6, 2023, 9:23am UTC](https://forums.unrealengine.com/t/how-to-create-meshes-in-construction-script-from-folder-in-bp/290695/7 "2023-01-06T09:23:30Z")

</div>

Hi,

[Shelby](https://forums.unrealengine.com/u/Shelby)  
I have the same issue, did you ever find a solution to this?
