Using a Single Line Trace (Raycast) by Channel
LineTraceForObjects will perform a collision trace along a given line and return the first Object the trace hits that matches one of the specified Object Types. To set up LineTraceForObjects trace, do the following:
Follow the steps used for the LineTraceByChannel example to set up a trace.
Replace the LineTraceByChannel node with the LineTraceForObjects node.
Drag off the Object Types pin and add the Make Array node.
On the Make Array node, specify the ObjectType you want to trace for (via the drop-down menu).
Here, we are tracing for WorldDyanmic Objects. You can add more by clicking the Add Pin button.
You can set the rest of the trace up the same way a LineTraceByChannel is setup.
Click image for a full view.
We have added a single WorldDynamic Object into our level.
Only the added Actor is now returning as a hit; consequently, the cubes (since they are Physics Actors) do not return a hit.