Get All from Array

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!

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,

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