Component Reference
Reference for AutoAimComponent (Content/AutoAimComponent/Blueprints/Main/AutoAimComponent). Default values match the component class defaults in the product project.
For Blueprint asset relationships, demo actors, and function inventory, see Blueprint reference.
---
config:
state:
nodeSpacing: 60
rankSpacing: 70
---
stateDiagram-v2
direction LR
[*] --> Idle
Idle --> Tracing: Start Trace
Tracing --> Locked: Hit pawn + valid interface
Tracing --> Failed: No hit / invalid target
Locked --> Locked: Event Tick updates look-at
Failed --> Idle: End Trace
Tracing --> Idle: On Auto Aim Started path completes
Locked --> Idle: End Trace
Locked --> Idle: Try Cancel Auto Aim From Input
Locked --> Idle: On Auto Aim Ended
note right of Locked
On Auto Aim Started
Set Look At Start/Target
Smooth or instant rotation
end note
note right of Failed
On Auto Aim Failed
Error message string
end note
Trace settings
Section titled “Trace settings”| Property | Default | Description |
|---|---|---|
| Trace Distance | 3000 | Total length of the box trace from the camera |
| Trace Size | 100 | Half-extent of the box trace |
| Types To Trace | Pawns (ObjectTypeQuery3) | Object types included in the trace |
| Ignore Actors | (empty) | Actors excluded from the trace |
| Start Look At Component | — | Optional scene component as trace origin |
| Check Line Of Sight | false | Verify unobstructed line to target before aiming |
| Override Socket Name | None | Force a socket; None = closest socket to hit |
Aiming behaviour
Section titled “Aiming behaviour”| Property | Default | Description |
|---|---|---|
| Update Every Frame | true | Re-read hit target location each frame vs cached hit |
| Use Smooth Aiming | true | Interpolate controller rotation |
| Interp Speed | 10 | Smoothing speed when smooth aiming is on |
| Use Manual Start Location | false | Use Start Location variable |
| Use Manual Target Location | false | Use Target Location variable |
| Use Distance Angle Check | false | Use CT_DistanceBasedAngle for break-off by look angle |
Free look
Section titled “Free look”| Property | Default | Description |
|---|---|---|
| Enable Free Looking | false | Allow look input offset while locked |
| Free Look Distance | 10 | Maximum free-look offset |
| Invert Free Look Pitch | false | Invert pitch for free look |
| Input Time To Cancel | 0.2 | Seconds of look-away input before cancel |
| Property | Default | Description |
|---|---|---|
| Draw Trace | false | Draw box trace in viewport |
| Draw Trace Hit Sphere | false | Debug sphere at hit location |
| Show Debug Trace Line | false | Line from start to target while aiming |
| Print Debug Messages | true | On-screen and log debug output |
Callable events
Section titled “Callable events”| Event | Parameters | Description |
|---|---|---|
| Start Trace | — | Begin box trace and attempt lock |
| End Trace | — | Stop tracing and end aim session |
| Try Cancel Auto Aim From Input | In Axis Value | Cancel when player looks away (uses Input Time To Cancel) |
| Free Look | Pitch Axis, Yaw Axis | Apply free-look offset while locked |
Functions
Section titled “Functions”| Function | Description |
|---|---|
| Set Actors To Ignore | Set actors excluded from tracing |
| Is Aiming Now | Whether component is actively aiming |
| Set Look At Start Location | World-space aim origin (usually camera) |
| Set Look At Target Location | World-space aim point (usually socket) |
| Get Hit Target | Actor locked by trace |
| Get Socket | Socket name used for aiming |
| Get Auto Aim Interface | BPI_AutoAim from hit target, if implemented |
Event dispatchers
Section titled “Event dispatchers”| Dispatcher | Parameters | When it fires |
|---|---|---|
| On Auto Aim Started | Trace hit result | Trace succeeded, target found |
| On Auto Aim Ended | — | Aiming ended normally |
| On Auto Aim Failed | Error message (string) | Trace failed or target unresolved |
sequenceDiagram
participant PC as Player Character
participant AAC as Auto Aim Component
participant T as Target (BPI_AutoAim)
PC->>AAC: Start Trace
AAC->>T: Box trace
alt Valid pawn + interface
AAC-->>PC: On Auto Aim Started
loop Each tick
PC->>AAC: Set Look At Start / Target
AAC->>PC: Controller rotation
end
else Miss or no interface
AAC-->>PC: On Auto Aim Failed
end
PC->>AAC: End Trace
AAC-->>PC: On Auto Aim Ended
BPI_AutoAim interface
Section titled “BPI_AutoAim interface”| Function | Returns | Description |
|---|---|---|
| Get Skeletal Mesh Component | Skeletal Mesh Component | Mesh used for socket aim points |
CT_DistanceBasedAngle curve table
Section titled “CT_DistanceBasedAngle curve table”Used when Use Distance Angle Check is enabled. Contains a DistanceAngle row mapping distance to maximum look-away angle before auto-aim cancels. Edit in Blueprints/Main/CT_DistanceBasedAngle.
Runtime state (read-only)
Section titled “Runtime state (read-only)”| Variable | Description |
|---|---|
| Hit Target | Actor locked by trace |
| Hit Location | World location of trace hit |
| Closest Socket | Socket name chosen for current target |
| Is Tracing Active | Whether trace session is active |
| Current Look At Rotation | Rotation being applied |
| Owner Pawn | Pawn that owns this component |
Example presets
Section titled “Example presets”See Example presets on the overview for copy-paste property combinations (demo default, forgiving lock, snap assist, head-only).