How to hit Mutliple Actors with one Trace?

Silly question here, but I have been having issues getting something work. I have a character apply damage on a click and then check to see if it hit. If it does, it applies damage. That’s well and good, but how do I get it to hit multiple different targets at once? Right now I have it run the check 3 times and add any previous hits to an array to be ignored, but surely there must be a better way?

Thank you.

Those images are pretty bad. But I am not sure what your issue is. You use a muti-sphere trace, so that will give you ALL hits during the trace duration. Just get the out “hit actors” and apply damage to each one of them…seems like you got it. I dunno if the issue is it is not hitting all different actor types as I see you only have “pawns” in the first image for the actors to trace against array, you can add multiple actor types to that array and it will return hits for all listed class types. Again, very confused here.

Multitraces are stoped once they hit a “blocking” obstacle. If you trace for pawns and their collision is set to block, the trace will stop once it hit a single pawn. What you want is a new collision channel that does not block your trace but is set to overlap only, that way your Multitrace will continue after hitting (overlapping) the first pawn.

If you still use the setup you pictured above, then try to remove the branch after the trace and instead of a get use a for each loop on the “Out Hits” array. In case you haven’t seen it, theres also a good video example of it WTF Is? Multi Line Trace For Objects in Unreal Engine 4 ( UE4 ) - YouTube

All of the actor types are the same. I can try to get better images if they would help explain.

What I am trying to do is hit multiple actors of the same type. It will only hit the first one it finds, unless I have it redo the logic again and add the hit actor to an ignore array.

I’ve looked over the pawns and none of the collisions are block, they are all overlap or pawn collision. Could you elaborate further? Thank you

That worked, thank you!

Looking at this again I see the issue. Multi-trace does not “stop” after the first hit, that is the whole point it will collect “multiple” hits and put them into an array. A single trace will stop however after the first blocking hit. Your issue as @soannoyed pointed out is the “get” node. You have it hard coded to “get” index 0…EVERY time. So you will only ever get one “hit” with applied damage with that set-up no matter how many “hit” results your trace returns. The for loop is the way to go as it will run your code for each index in the array and apply damage accordingly.