Shooting functions - Line Tracing

Enemy Target Lock System



open 3rd person BP
Create follow graph (For Target Lock Trace and Hit):
image.png
Extend the graph by adding break hit result, promote hit actor variable, rename as hit target
image.png
and make event tick (For Set Target Lock Rotation)
image.png

Create a BP Pawn, name as BP_Enemy
Put a skeletal mesh, set its collison preset as Pawn (coz the 3rd person BP Make Array node set as Pawn)


Now all pawn targets will be locked when player checks them out, but can’t unlock them (roation axis is fixed at the locking status).
To unlock, revise the 3rd person BP as follow:
image.png

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.