# Looping through an array of target points

**URL:** <https://forums.unrealengine.com/t/looping-through-an-array-of-target-points/451801>\
**Category:** Audio\
**Tags:** target-point, unreal-engine, spawning-actors, loop, Blueprint, question\
**Created:** [July 6, 2019, 4:37pm UTC](https://forums.unrealengine.com/t/looping-through-an-array-of-target-points/451801 "2019-07-06T16:37:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_3c29d6a2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3c29d6a2](https://forums.unrealengine.com/u/anonymous_user_3c29d6a2)\
**Post date:** [July 6, 2019, 4:37pm UTC](https://forums.unrealengine.com/t/looping-through-an-array-of-target-points/451801/1 "2019-07-06T16:37:01Z")

</div>

I am trying to loop through an array of target points, shuffle them and then spawn a tree in each target point. Please find my blueprint attached

 ![281636-unreal-blueprint.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/f/6/bf6d3347b8c169cb807809d76c353a76c53dde50.png)

Any ideas on how to achieve this?

---

<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:** [July 6, 2019, 5:52pm UTC](https://forums.unrealengine.com/t/looping-through-an-array-of-target-points/451801/2 "2019-07-06T17:52:28Z")

</div>

What you have there looks fine, apart from you need to connect the begin play to the shuffle…

---

<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:** [July 7, 2019, 8:06am UTC](https://forums.unrealengine.com/t/looping-through-an-array-of-target-points/451801/3 "2019-07-07T08:06:09Z")

</div>

This is not working (well / at all) for a several reasons:

- you can’t shuffle contents of the _Make Array_ node
- the 9th index is null
- shuffle is not even connected as mentioned in the comment above

* * *

To make it work, you’d need to store the result of Make Array in an additional array variable, shuffle that, and then do a _For Each Loop_.
