Make Line Tracing


Line trace function: to do thing (e.g. apply damage) from point A to point B


Use 1st person Template.

In Project setting, check if action input button, Primary Action is valid (default is left click mouse and gamepad trigger)
go to 1st person BP, event graph:
Screenshot 2022-12-23 at 11.28.15 AM.png
Add Line tracing node behind the graph Call on Use item as:
Screenshot 2022-12-23 at 11.31.27 AM.png
float value 1500 determines how far the trace line spreading out (change to 15000 in his case)
Draw time determines how long the traced hit object be active by the trace line.

Continune:
Screenshot 2022-12-23 at 11.35.51 AM.png

Now the print string indicates what objects are in the trace whenever they are hit, and its XYZ location values.
Hit left mouse click/gamepad trigger to detect its trace.

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.