Multi Trace Duplicates Items

The multi trace function i created has a chance of duplicating the item depending where your standing in the sphere collision for the item meaning that if i try to pick up a medkit from the ground it could pick up the apple instead while still destroying medkit actor since it shows more than 1 of the apple but when i print string for debug it shows correctly what has been hit. In the image below, Debug is orange and the function is blue on print strings. Why does the function duplicate while on my debug it uses the same function but shows correctly?

In the MultiTrace function AddUnique doesn’t add the apple to the array, but the next node does debug log it a second time. I believe this is why you’re getting different printed results.

If you only want to print string added elements you could branch with the return value of AddUnique and test for != -1 (index none is -1, which in this case means it’s already in the array and wasn’t added). In the future lookup blueprint debugging so you can place a breakpoint (f9) and follow what is happening.

I think multi sphere trace returns all overlaps so if your apple has two components with visibility trace channel then apple will be in the results twice.
You might want sphere overlap actors instead, especially since your start and end location are the same and there is a handy actor class filter.

As far as which item it is picking up or deleting, you’d have to post those graphs. Try blueprint debugging yourself first. GL