# Get All from Array

**URL:** <https://forums.unrealengine.com/t/get-all-from-array/451008>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [June 20, 2019, 5:27pm UTC](https://forums.unrealengine.com/t/get-all-from-array/451008 "2019-06-20T17:27:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Lindsay](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Andrew\_Lindsay](https://forums.unrealengine.com/u/Andrew_Lindsay)\
**Post date:** [June 20, 2019, 5:27pm UTC](https://forums.unrealengine.com/t/get-all-from-array/451008/1 "2019-06-20T17:27:17Z")

</div>

Hello,

I have an array of static mesh actors in my level blueprint. Basically I want all of the actors in the array to be destroyed when a key is pressed. The main difficulty I’m having is getting ‘all’ from the array - I can return a single item, but I was can’t seem to figure out how to get multiple results from my array at the same time. Any advice would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [June 20, 2019, 6:38pm UTC](https://forums.unrealengine.com/t/get-all-from-array/451008/2 "2019-06-20T18:38:46Z")

</div>

Get All nodes return arrays - use `For Each Loop` node to iterate through the elements:

 ![280329-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/7/8/2785e12be1aece86573a8f0be76e2f23395f4018.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b131d547](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b131d547](https://forums.unrealengine.com/u/anonymous_user_b131d547)\
**Post date:** [June 20, 2019, 6:50pm UTC](https://forums.unrealengine.com/t/get-all-from-array/451008/3 "2019-06-20T18:50:37Z")

</div>

Hello Andrew,

To destroy every element in an array you will need to access every element of an array sequentially. To do this you could use a for each loop. Make sure to create your ForEachLoop from whatever you array you want to traverse. These nodes are created to work with one data type, i.e. an int ForEachLoop will not accept an array of rotators as a valid input.

From,

 ![280339-destroyarrayofactors.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/3/3/5333b321dd7cd7b90056d49203f995acea3f946c.png)

 ![280340-createforeachloop.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/0/0/e0012802f67fe08396ce0a52568091daa136ed3c.png)
