Reference for Blueprint assets under Content/AutoAimComponent/. Default values were read from class defaults in the product project via the Unreal editor.
For editable property descriptions and gameplay-oriented API notes, see Component reference.
flowchart TB
FPC["FirstPersonCharacter<br/>Auto Aim Component · First Person Camera · InputActionStartTargeting"]
AAC["AutoAimComponent<br/>TraceDistance: 3000 · TraceSize: 100 · InterpSpeed: 10<br/>StartTrace() · EndTrace() · GetHitTarget()"]
NPC["ThirdPersonCharacter_NPC<br/>bCanMove · BPI_AutoAim"]
BPI["«Interface» BPI_AutoAim<br/>GetSkeletalMeshComponent()"]
CT["CT_DistanceBasedAngle<br/>DistanceAngle row"]
FPC -->|owns| AAC
FPC -->|GetAutoAimInterface| BPI
NPC -.->|implements| BPI
AAC -->|CheckDistanceAngle| CT
AAC -->|box trace HitTarget| NPC
| Asset | Path | Role |
|---|
| AutoAimComponent | Blueprints/Main/AutoAimComponent | Core aim component (migrate) |
| BPI_AutoAim | Blueprints/Main/BPI_AutoAim | Target interface (migrate) |
| CT_DistanceBasedAngle | Blueprints/Main/CT_DistanceBasedAngle | Distance–angle curve (migrate) |
| FirstPersonCharacter | Blueprints/FirstPersonCharacter | Demo player integration |
| ThirdPersonCharacter_NPC | Blueprints/ThirdPersonCharacter_NPC | Demo aimable target |
| FirstPersonGameMode | Blueprints/FirstPersonGameMode | Demo game mode |
| FirstPersonProjectile | Blueprints/FirstPersonProjectile | Demo weapon projectile |
| WBP_PlayerHUD | Blueprints/WBP_PlayerHUD | Demo HUD widget |
| AutoAimComponentExampleMap | Map/AutoAimComponentExampleMap | Demo level |
Parent class: ActorComponent
Blueprint component added to a Character or Pawn. Performs box traces, resolves skeletal sockets on BPI_AutoAim targets, and drives controller rotation.
| Property | Default | Notes |
|---|
| Trace Distance | 3000 | Box trace length from camera |
| Trace Size | 100 | Box half-extent |
| Types To Trace | Pawns (ObjectTypeQuery3) | Object types for trace |
| Use Smooth Aiming | true | Interpolate controller rotation |
| Interp Speed | 10 | Smooth aim speed |
| Update Every Frame | true | Re-read target each tick |
| Check Line Of Sight | false | LOS gate before aiming |
| Use Distance Angle Check | false | Uses CT_DistanceBasedAngle |
| Enable Free Looking | false | Look offset while locked |
| Free Look Distance | 10 | Max free-look offset |
| Input Time To Cancel | 0.2 | Look-away time before cancel |
| Override Socket Name | None | Force socket; else closest |
| Draw Trace | false | Debug box trace |
| Print Debug Messages | true | Screen / log debug |
| Variable | Purpose |
|---|
| Hit Target | Actor locked by trace |
| Hit Location | World hit from trace |
| Closest Socket | Resolved socket name |
| Is Tracing Active | Trace session active |
| Owner Pawn | Owning pawn reference |
| Current Look At Rotation | Applied aim rotation |
| Start Location / Target Location | Manual look-at points |
| Ignore Actors | Trace exclusion list |
| Camera Component | Internal camera reference |
| Start Look At Component | Optional trace origin override |
| Event | Parameters | Description |
|---|
| Start Trace | — | Begin box trace; fire On Auto Aim Started or Failed |
| End Trace | — | Stop trace and end aim session |
| Try Cancel Auto Aim From Input | In Axis Value (float) | Break lock when player looks away |
| Free Look | Pitch Axis, Yaw Axis (float) | Offset aim while locked |
| Function | Description |
|---|
| Set Actors To Ignore | Replace trace ignore list |
| Is Aiming Now | Returns whether aim is active |
| Set Look At Start Location | Set aim origin (Vector by ref) |
| Set Look At Target Location | Set aim target (Vector by ref) |
| Get Hit Target | Returns locked actor |
| Get Socket | Returns socket name for aiming |
| Get Auto Aim Interface | Returns BPI_AutoAim from Hit Target |
| Function | Description |
|---|
| Internal_Trace | Box trace implementation |
| Internal_TraceFailed | Failed trace handling |
| Internal_GetLookAtRotation | Compute aim rotation |
| Internal_GetLookAtStartLocation | Resolve start point |
| Internal_GetLookAtTargetLocation | Resolve target point |
| Internal_GetClosestSocketFromLocation | Pick nearest socket |
| Internal_HasLineOfSight | LOS check to target |
| Internal_ShowDebugTraceLine | Debug line draw |
| CheckDistanceAngle | Curve-based break-off test |
| Dispatcher | Parameters |
|---|
| On Auto Aim Started | Trace hit result |
| On Auto Aim Ended | — |
| On Auto Aim Failed | Error message (string) |
sequenceDiagram
participant Caller as Player Blueprint
participant AAC as AutoAimComponent
participant Target as BPI_AutoAim actor
Caller->>AAC: Start Trace
AAC->>AAC: Internal_Trace
alt Hit pawn
AAC-->>Caller: On Auto Aim Started
loop Event Tick
Caller->>AAC: Set Look At Start / Target
Caller->>Target: Get Auto Aim Interface
AAC->>AAC: Internal_GetLookAtRotation
end
else Miss
AAC-->>Caller: On Auto Aim Failed
end
Caller->>AAC: End Trace
AAC-->>Caller: On Auto Aim Ended
Blueprint interface — implement on any Character with a skeletal mesh you want to lock onto.
| Function | Returns | Description |
|---|
| Get Skeletal Mesh Component | Skeletal Mesh Component | Mesh used for socket locations |
Implemented by: ThirdPersonCharacter_NPC (returns Mesh).
Curve table asset used when Use Distance Angle Check is enabled on AutoAimComponent.
| Row | Purpose |
|---|
| DistanceAngle | Maps distance to maximum look-away angle before cancel |
Edit keys in the DistanceAngle row to tune break-off feel at different ranges.
Parent class: Character
Demo player Blueprint on AutoAimComponentExampleMap. Shows full integration pattern.
| Component | Purpose |
|---|
| Auto Aim Component | Lock-on / aim assist |
| First Person Camera | View + trace origin |
| FP_Gun | First-person weapon mesh |
| Mesh2P | Arms mesh |
| Sphere | Collision / interaction |
| Variable | Purpose |
|---|
| Gun Offset | Weapon offset from camera |
| Base Turn Rate | Mouse turn scale |
| Base Look Up Rate | Mouse pitch scale |
| Player HUD | WBP_PlayerHUD reference |
| Input | Calls |
|---|
| InputActionStartTargeting (pressed) | Start Trace |
| InputActionStartTargeting (released) | End Trace |
| Turn / Look Up axis | Free Look, Try Cancel Auto Aim From Input |
| Event | Behaviour |
|---|
| Event Tick | Get Hit Target → Get Auto Aim Interface → socket location → Set Look At Start/Target Location |
| On Auto Aim Started | Uses trace hit result (bound on component) |
| On Auto Aim Ended | Cleanup (bound on component) |
| On Auto Aim Failed | Error feedback (bound on component) |
Parent class: Character
Demo NPC target placed on AutoAimComponentExampleMap (four instances in the level).
| Interface | Implementation |
|---|
| BPI_AutoAim | Get Skeletal Mesh Component → Mesh |
| Variable | Purpose |
|---|
| Base Turn Rate | NPC turn rate (demo) |
| Base Look Up Rate | NPC look rate (demo) |
| b Can Move | Movement toggle (demo) |
| Graph | Purpose |
|---|
| GetSkeletalMeshComponent | Interface function |
| EventGraph | Standard character logic |
| UserConstructionScript | Construction script |
These ship with the example project and are not required for migration.
| Asset | Parent | Notes |
|---|
| FirstPersonGameMode | GameModeBase | Default mode for example map |
| FirstPersonProjectile | Actor | Spawned on Fire input |
| FirstPersonHUD | HUD | Legacy HUD class |
| WBP_PlayerHUD | UserWidget | Crosshair / HUD widget |