# Automate Filling of Default Values in an Empty Array Inside a Struct?

**URL:** <https://forums.unrealengine.com/t/automate-filling-of-default-values-in-an-empty-array-inside-a-struct/454918>\
**Category:** Blueprint\
**Tags:** Struct, Blueprint-Utilities, Blutilities, unreal-engine, Automation, editor, question, Blueprint\
**Created:** [September 6, 2019, 2:58am UTC](https://forums.unrealengine.com/t/automate-filling-of-default-values-in-an-empty-array-inside-a-struct/454918 "2019-09-06T02:58:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Agent\_Sckit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Agent\_Sckit](https://forums.unrealengine.com/u/Agent_Sckit)\
**Post date:** [September 6, 2019, 2:58am UTC](https://forums.unrealengine.com/t/automate-filling-of-default-values-in-an-empty-array-inside-a-struct/454918/1 "2019-09-06T02:58:01Z")

</div>

Good day community! I’m new to the engine and hoping to find a method, if there exist, on how to solve my problem. I have a struct that contains array of sprites. Each array will contain 100 sprites of name “S\_example\_0” up to “S\_example\_099”. Is there a way to fill the empty array of sprites automatically? It would be so repetitive and annoying if it has to be done manually.

Many thanks!

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [September 6, 2019, 4:13am UTC](https://forums.unrealengine.com/t/automate-filling-of-default-values-in-an-empty-array-inside-a-struct/454918/2 "2019-09-06T04:13:03Z")

</div>

I don’t think there a way other then C++, which you could loop element adding in constructor and CDO would inherent that.

But you always have option to set defaults on actor start up, with array is actually easier as you can always check size of set array. Could fill array with default content in run time (Construction script or BeginPlay) not sure what you trying to dp but for example, let say you add 16 elements to empty array if defaults, on begin play you would check the size of array and fill rest of array with generated default content.

Also you need to do this just once, doing 100 should not be that much of a big hussle in base class or other classes will inherent and in future you can copy paste properties (yes you can right click property and copy paste there settings)

---

<div class="post-metadata">

**Author:** ![Agent\_Sckit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Agent\_Sckit](https://forums.unrealengine.com/u/Agent_Sckit)\
**Post date:** [September 7, 2019, 3:16am UTC](https://forums.unrealengine.com/t/automate-filling-of-default-values-in-an-empty-array-inside-a-struct/454918/3 "2019-09-07T03:16:30Z")

</div>

Thanks for the idea but the problem is that in my project, I have to fill the **default values** of an array _inside_ a struct of name “example\_0 to example\_n”. Like I’m looking for an automated way to do it instead of doing a manual fill of default values…

“a struct”  
—“an array” → set dafault value of arrays  
—example\_0.sprite  
—example\_1.sprite  
—…  
—…  
—…  
—example\_n.sprite

You also mentioned it can be done in c++? Would that mean there is an automated way for C++ to fill the default values in an array within a struct?

Many thanks!
