# Array shows incorrect length after adding destroyed actors and clearing in Blueprints 

**URL:** <https://forums.unrealengine.com/t/array-shows-incorrect-length-after-adding-destroyed-actors-and-clearing-in-blueprints/2707694>\
**Category:** Blueprint\
**Tags:** unreal-engine, bug-report\
**Created:** [March 20, 2026, 2:37pm UTC](https://forums.unrealengine.com/t/array-shows-incorrect-length-after-adding-destroyed-actors-and-clearing-in-blueprints/2707694 "2026-03-20T14:37:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![IamIvanich](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IamIvanich](https://forums.unrealengine.com/u/IamIvanich)\
**Post date:** [March 20, 2026, 2:37pm UTC](https://forums.unrealengine.com/t/array-shows-incorrect-length-after-adding-destroyed-actors-and-clearing-in-blueprints/2707694/1 "2026-03-20T14:37:41Z")

</div>

After clearing the array using the “Clear” or “Make array” function, when I call “Lenght” in another Actor, I get the length of the array before it was cleared. Although it is currently empty.

The array itself is stored in the Game instance

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/5/a/f5ac612748b8ab17e043b67282a9095d122dfebb.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/6/c/66cf68d0b6a1dc59e652c17a22913f70d807091d.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/0/1/8016b9214ebed3fcb1f18169a180e35f2486117c.png)

---

<div class="post-metadata">

**Author:** ![Infant\_Zero](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/infant_zero/32/715655_2.png) [@Infant\_Zero](https://forums.unrealengine.com/u/Infant_Zero)\
**Post date:** [March 21, 2026, 4:44am UTC](https://forums.unrealengine.com/t/array-shows-incorrect-length-after-adding-destroyed-actors-and-clearing-in-blueprints/2707694/2 "2026-03-21T04:44:29Z")

</div>

I would suggest using print strings at each of the appropriate points. Essentially, if the array reports that it’s full, it is. Check that your casts aren’t failing, that you don’t have multiple independent variables by the same name across multiple BPs, or (for multiplayer) whether you’re affecting the client or server.

If your print strings report different, simultaneous values, then you know you have multiple instances of something–the variable and/or the game instance. The array might also need to be instance editable.

Just throwing out ideas.

---

<div class="post-metadata">

**Author:** ![IamIvanich](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IamIvanich](https://forums.unrealengine.com/u/IamIvanich)\
**Post date:** [March 21, 2026, 7:52am UTC](https://forums.unrealengine.com/t/array-shows-incorrect-length-after-adding-destroyed-actors-and-clearing-in-blueprints/2707694/3 "2026-03-21T07:52:31Z")

</div>

I have one game instace. And I don’t have a multiplayer game.

---

<div class="post-metadata">

**Author:** ![IamIvanich](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IamIvanich](https://forums.unrealengine.com/u/IamIvanich)\
**Post date:** [March 21, 2026, 9:31am UTC](https://forums.unrealengine.com/t/array-shows-incorrect-length-after-adding-destroyed-actors-and-clearing-in-blueprints/2707694/4 "2026-03-21T09:31:25Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/3/2/732a62a9540763b977d42ae8c362ba6385fb8575.png)

I think I’ve solved the problem. I just wrapped all the logic in a function. And it doesn’t cache the array. It’s strange, but it works.

---

<div class="post-metadata">

**Author:** ![Infant\_Zero](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/infant_zero/32/715655_2.png) [@Infant\_Zero](https://forums.unrealengine.com/u/Infant_Zero)\
**Post date:** [March 21, 2026, 2:33pm UTC](https://forums.unrealengine.com/t/array-shows-incorrect-length-after-adding-destroyed-actors-and-clearing-in-blueprints/2707694/5 "2026-03-21T14:33:08Z")

</div>

Yeah, functions destroy and create themselves anew; I learned that with a ‘DoOnce’ not too long ago.

Glad you figured it out. Cheers.
