Choose your operating system:
Windows
macOS
Linux
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 a LineTraceForObjects Blueprint, do the following:
Steps
-
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.
Result
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.