Skip to content

Play the demo

Before wiring the component into your own game, run the included example so you know which Blueprints and inputs are involved.

sequenceDiagram
  participant Player as FirstPersonCharacter
  participant Input as InputActionStartTargeting
  participant AAC as Auto Aim Component
  participant NPC as ThirdPersonCharacter_NPC

  Player->>Input: Press (hold)
  Input->>AAC: Start Trace
  AAC->>NPC: Box trace hits pawn
  AAC-->>Player: On Auto Aim Started
  loop Event Tick while locked
    Player->>AAC: Set Look At Start / Target Location
    AAC->>Player: Smooth controller rotation
  end
  Player->>Input: Release
  Input->>AAC: End Trace
  AAC-->>Player: On Auto Aim Ended
  1. Add Auto Aim Component from FAB and open the project in Unreal Engine.
  2. The editor should load AutoAimComponentExampleMap (Content/AutoAimComponent/Map/AutoAimComponentExampleMap).
  3. Press Play (PIE).

The level places FirstPersonCharacter as the player and four ThirdPersonCharacter_NPC instances as lock-on targets.

This mirrors the default demo wiring.

  1. Look at a mannequin NPC within roughly 3000 units.
  2. Press and hold the Start Targeting input (InputActionStartTargeting on FirstPersonCharacter).
  3. The camera smoothly rotates toward the closest skeletal socket on the hit pawn (default Interp Speed 10).
  4. Release Start Targeting — lock ends and End Trace runs.

If you aim at empty space and press Start Targeting, On Auto Aim Failed fires instead of a lock.

InputBlueprint hookWhat happens
Start Targeting (pressed)InputActionStartTargetingStart TraceBox trace from camera; acquire pawn target
Start Targeting (released)InputActionStartTargetingEnd TraceStop targeting
Turn / Look Up (mouse)Axis events → Free Look + Try Cancel Auto Aim From InputOffset aim or break lock when looking away
FireSeparate projectile logicDemo weapon — not part of auto-aim

Use these on the Auto Aim Component attached to FirstPersonCharacter, then PIE and hold Start Targeting on the same NPC at the same distance.

StepTrace DistanceTrace SizeWhat you should notice
13000100Baseline — demo default
24000150Easier to acquire from farther / off-center
3200060Must aim closer and more directly at the NPC

Enable Draw Trace temporarily to visualize the box in the viewport.

AssetWhy open it
FirstPersonCharacterAuto Aim Component child, Start Trace / End Trace, per-tick look-at, event bindings
ThirdPersonCharacter_NPCBPI_AutoAim + Get Skeletal Mesh Component
AutoAimComponentTrace logic, Start Trace / End Trace events, default properties
BPI_AutoAimInterface required on aimable actors