targeted_actor
Trace from the camera or a reference actor to identify the targeted actor, component, and impact details in a running Unreal Engine game.
Instructions
What the player is looking at: a line trace from the camera along its forward vector.
distance is in centimetres (the engine's unit), default 5000. channel is a trace channel: 0 = Visibility, 1 = Camera. ref traces from that actor's own location and forward vector instead of the camera, which is how you ask what an NPC faces.
Returns {hit} alone on a miss, otherwise {hit, actor, actor_class, component, component_class, distance, impact_point, impact_normal, bone, phys_material, materials}. actor is the hit component's owner; materials are the component's material full names (first 32) when it exposes GetMaterials. Read-only: it works with allow_writes = false.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | ||
| channel | No | ||
| distance | No |