I’m trying to use SweepMultiByChannel to sweep a sphere through the world (like Sphere Trace in Blueprint) from the player to a distance in front of them, to get an array of every actor hit by the sphere.
The problem I’m having is that it only returns multiple hits if the player is standing directly on top of a bunch of actors. The sweep only returns a max of 1 hit otherwise and for the life of me I cannot figure out why… It’s almost like it only checks the start location for multiple hits and the sweep through the world only gets 1 hit…
Thanks for the reply, however this code seems to have the same problem. At first glance it looks like it works, but that is only because the radius of the cast is huge so the start trace is hitting all of the actors surrounding the player. If you reduce it to 100.0 (1 meter) then you’ll notice it returns 1 hit max outside of the trace start location.
Unfortunately I went ahead and recreated my code in blueprint using the sphere trace node and I’m getting the same problem which makes me think this is either a limitation of channel tracing or with using visibility/camera as the trace channel. Not really sure why this would be but I can’t think of any other explanation.
Turns out this was just due to my lack of understanding of Unreal traces.
Tracing/sweeping by Channel only returns the overlaps up to the first blocking hit. In my defense, the debug drawing for these sweep/trace types does not indicate that at all.