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 ?
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.
Let me know if that works for you.
Works now with the array.
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.
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?
This is inconsistent behavior and not documented clearly, how is this a Non issue?