# How to assign an empty item to an index in an object array?

**URL:** <https://forums.unrealengine.com/t/how-to-assign-an-empty-item-to-an-index-in-an-object-array/2744299>\
**Category:** Blueprint\
**Tags:** Variable, object, unreal-engine, Array\
**Created:** [August 17, 2026, 8:21am UTC](https://forums.unrealengine.com/t/how-to-assign-an-empty-item-to-an-index-in-an-object-array/2744299 "2026-08-17T08:21:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SemanticRain619](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SemanticRain619](https://forums.unrealengine.com/u/SemanticRain619)\
**Post date:** [August 17, 2026, 8:21am UTC](https://forums.unrealengine.com/t/how-to-assign-an-empty-item-to-an-index-in-an-object-array/2744299/1 "2026-08-17T08:21:51Z")

</div>

I want to clear the items in an array without disrupting the indices; how can I remove the assigned values ​​while keeping the indices intact? I thought I could use “Set Array Elem,” but it didn’t work for this purpose.

---

<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:** [August 17, 2026, 8:53am UTC](https://forums.unrealengine.com/t/how-to-assign-an-empty-item-to-an-index-in-an-object-array/2744299/2 "2026-08-17T08:53:22Z")

</div>

Set array will work, but you need an ‘empty’ value. For instance -1 in an int array.

---

<div class="post-metadata">

**Author:** ![SemanticRain619](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SemanticRain619](https://forums.unrealengine.com/u/SemanticRain619)\
**Post date:** [August 17, 2026, 10:59am UTC](https://forums.unrealengine.com/t/how-to-assign-an-empty-item-to-an-index-in-an-object-array/2744299/3 "2026-08-17T10:59:44Z")

</div>

How do I create an empty value for an object type? If nothing is entered, the index will not be updated.

---

<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:** [August 17, 2026, 11:06am UTC](https://forums.unrealengine.com/t/how-to-assign-an-empty-item-to-an-index-in-an-object-array/2744299/4 "2026-08-17T11:06:43Z")

</div>

You enter it with your ‘dummy’ value.

Or, another way to do this would be to use a map data type instead. That way you _can_ have a sparse array.

---

<div class="post-metadata">

**Author:** ![SemanticRain619](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SemanticRain619](https://forums.unrealengine.com/u/SemanticRain619)\
**Post date:** [August 18, 2026, 2:15am UTC](https://forums.unrealengine.com/t/how-to-assign-an-empty-item-to-an-index-in-an-object-array/2744299/5 "2026-08-18T02:15:25Z")

</div>

The result was the same even when I connected an empty local variable. Regarding Map, there is no guarantee that the index is accurately maintained. That is the most important point.

---

<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:** [August 18, 2026, 5:31am UTC](https://forums.unrealengine.com/t/how-to-assign-an-empty-item-to-an-index-in-an-object-array/2744299/6 "2026-08-18T05:31:20Z")

</div>

With the map, you’re maintaining them 😃
