SweepMultiByChannel Returns same Actor multiple times
Hello, I'm having a problem using the function SweepMultiByChannel. I am creating an Sphere using SweepMultiByChannel to detect nearby actors within an specific radius. When I place a pawn actor with basic mesh, collision and object type Pawn, The Sphere generated fills the TArray result with only one actor reference, which is the functionality that I'm trying to accomplish. But when I place an skeletal mesh inside the sphere, the SweepMultiByChannel Function, fills the return array with several references of the same skeletal mesh owner actor. The objective would be to return ONLY ONE reference of EACH actor inside the result array. I'm aware that going through the array and removing duplicated actor references would solve the issue, but this would be extremely inefficient. May be I'm not using the function the right way. Here is the code that uses the SweepMultiByChannel function:
In the image is the sphere being generated from a cube, and printed are the actors returned in the array, I painted over the actors that doesn't matter in this question (cube, floor, projectile, etc)
Your only other option is to maybe set up a loop of single sweeps that adds each actor it touches to an ignore list and keeps single-sweeping until it returns NULL, breaking the loop.
answered Sep 03 '18 at 08:15 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here