# Get Overlapping Actors dont return all actors

**URL:** <https://forums.unrealengine.com/t/get-overlapping-actors-dont-return-all-actors/314514>\
**Category:** Blueprint\
**Tags:** overlapping, actor, unreal-engine, bug-report, Blueprint, question\
**Created:** [April 10, 2015, 12:32am UTC](https://forums.unrealengine.com/t/get-overlapping-actors-dont-return-all-actors/314514 "2015-04-10T00:32:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_21672ece1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_21672ece1](https://forums.unrealengine.com/u/anonymous_user_21672ece1)\
**Post date:** [April 10, 2015, 12:32am UTC](https://forums.unrealengine.com/t/get-overlapping-actors-dont-return-all-actors/314514/1 "2015-04-10T00:32:33Z")

</div>

The Blueprint and Picture should speak for it self … The OnPickedUp function just calls Destroy Actor …

I Pickup this Items on spacebar press. The Pickup itself is working but I dont pick up all Items in range.  
The ingame Screenshot show a much too big Box Collision(its almost bigger than the level itself to ensure all items are in) … all Items are within it!  
Now when i hit spacebar some items dissapear BUT NOT ALL  
they dissapear in a distinct order and i can make them all dissapear by just hitting space a few times and i dont even have to move so the Box isnt moving.

I dont get why they are not found all in the first spacebar press … Am I missing something on this simple blueprint ?

 ![38275-blueprint.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/9/a/89a328dac8c6074e77a92fe61fffe03ffcc3d226.png)  
 ![38276-game.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/d/b/6dbc7b93941f12b1823a2415f511a2eacb74b4db.png)

---

<div class="post-metadata">

**Author:** ![TJ\_V](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tj_v/32/1008648_2.png) [@TJ\_V](https://forums.unrealengine.com/u/TJ_V)\
**Post date:** [April 10, 2015, 5:11pm UTC](https://forums.unrealengine.com/t/get-overlapping-actors-dont-return-all-actors/314514/2 "2015-04-10T17:11:41Z")

</div>

Hi L1ne,

Thank you for the report. I was easily able to reproduce the issue so I have created JIRA report UE-13672. Our developers will be investigating it further and we will post back here with updates as we have them.

As a workaround, I noticed that if you add the overlapped actors to an Array then loop through that array, it will work correctly.

 ![38338-getoverlap04.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/b/e/2bebb0b0adce243ad2a89e2a1d754de11175d871.jpeg)

Let me know if that works for you.

Cheers,

TJ

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_21672ece1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_21672ece1](https://forums.unrealengine.com/u/anonymous_user_21672ece1)\
**Post date:** [April 10, 2015, 10:39pm UTC](https://forums.unrealengine.com/t/get-overlapping-actors-dont-return-all-actors/314514/3 "2015-04-10T22:39:59Z")

</div>

Works now with the array.

THX

---

<div class="post-metadata">

**Author:** ![TJ\_V](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tj_v/32/1008648_2.png) [@TJ\_V](https://forums.unrealengine.com/u/TJ_V)\
**Post date:** [April 13, 2015, 1:50pm UTC](https://forums.unrealengine.com/t/get-overlapping-actors-dont-return-all-actors/314514/4 "2015-04-13T13:50:14Z")

</div>

L1ne,

I’ve been working with one of our devs on this and he explained that this is a common misunderstanding and the expected behavior of the GetOverlappingActors array.

The array that’s created by the GetOverlappingActors node isn’t ‘set’ like a standard array. The size can be changed each time a ForEachLoop is iterated. Because of this, with each loop the array size changes leaving behind some of the overlapped objects. This is a little hard to explain in just text so if you would like me to go into further detail, just let me know.

Anyways, the workaround that I gave you isn’t a workaround, it is actually the correct way to implement this.

Cheers,

TJ

---

<div class="post-metadata">

**Author:** ![cgrebeld](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cgrebeld](https://forums.unrealengine.com/u/cgrebeld)\
**Post date:** [October 9, 2015, 6:31pm UTC](https://forums.unrealengine.com/t/get-overlapping-actors-dont-return-all-actors/314514/5 "2015-10-09T18:31:56Z")

</div>

I would very much like to hear more details about this! I assume it applies to all functions that have an output TArray parameter? In what case would this array be changed as you loop over it?

---

<div class="post-metadata">

**Author:** ![overreal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@overreal](https://forums.unrealengine.com/u/overreal)\
**Post date:** [April 1, 2022, 1:41am UTC](https://forums.unrealengine.com/t/get-overlapping-actors-dont-return-all-actors/314514/6 "2022-04-01T01:41:39Z")

</div>

This is inconsistent behavior and not documented clearly, how is this a Non issue?

---

<div class="post-metadata">

**Author:** ![overreal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@overreal](https://forums.unrealengine.com/u/overreal)\
**Post date:** [October 27, 2022, 4:06am UTC](https://forums.unrealengine.com/t/get-overlapping-actors-dont-return-all-actors/314514/7 "2022-10-27T04:06:55Z")

</div>

Reporting, this workaround doesn’t work when I use SphereOvrelapActors in a AnimNotify. It works only in an Actor.

---

<div class="post-metadata">

**Author:** ![astro123458](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@astro123458](https://forums.unrealengine.com/u/astro123458)\
**Post date:** [September 29, 2023, 4:03am UTC](https://forums.unrealengine.com/t/get-overlapping-actors-dont-return-all-actors/314514/8 "2023-09-29T04:03:58Z")

</div>

Can I just say(If I can) thank you for the workaround and I have some info on it that could help(if it’s not too late). I noticed that it’s specifically half the actors getting missed, and it only happened for me when the mobility of the actor was set to moveable, thanks and I hope the info helps!

---

<div class="post-metadata">

**Author:** ![zompi2](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zompi2/32/937524_2.png) [@zompi2](https://forums.unrealengine.com/u/zompi2)\
**Post date:** [March 21, 2024, 10:50am UTC](https://forums.unrealengine.com/t/get-overlapping-actors-dont-return-all-actors/314514/10 "2024-03-21T10:50:48Z")

</div>

I just came across this issue today and luckily the workaround works 🙂  
Just for the better context: the easiest way to explain such behaviour is that the “GetOverlappingActors” is a Pure function, that means it is (probably) called every for loop iteration. So the “workaround” is not workaround but a valid way of handling it. First - copy the result to local array and then work on that copy without calling “GetOverlappingActors” every time.
