How-To: Show Lock-On Indicators

Goal: draw on-screen indicators over lockable targets - a soft marker on candidates you can lock onto, and, once you lock a target, an indicator on each of its lock points with the active one highlighted.

Prerequisites
You completed How-To: Set Up Lock-On, and each lockable actor's LockOnPoints use socket/bone names that exist on its skeletal mesh (an unresolved name falls back to the actor centre and logs a one-time warning).

1. It works out of the box

CrimsonCamera ships a default indicator widget and points the project setting at it through Config/DefaultCrimsonCamera.ini, so indicators appear as soon as lock-on works - no wiring required. The rest of this page is about customizing them.

Verify
With lock-on working and no extra setup, a marker already appears over lockable targets - the shipped default widget is active.

2. Use your own indicator widget

Make a Blueprint subclass of UCrimsonLockOnIndicatorWidget (your art), then point either the project default or a single actor at it.

Project Settings -> Crimson -> Crimson Camera -> Default Lock-On Indicator Widget = your widget. To override just one actor, set its Crimson Lock On Target Component -> Indicator Widget Class Override (leave it unset everywhere else).
Override wins over the default
A target's IndicatorWidgetClassOverride (null by default) takes precedence over the project default, so you change one special target without touching the rest. bShowIndicator on the component disables the indicator for that actor entirely.
Verify
Set the project default to your widget and the markers switch to your art everywhere; set one actor's override and only that target changes.

3. Drive the two states

Each indicator has two states: Available ("can be locked on", soft) and Locked ("we ARE locked on", hard). In your widget, handle On Indicator State Changed to swap visuals - e.g. a dot for Available, a ring for Locked. Positioning (centred on the lock point) and distance scaling are handled for you.

Widget Blueprint -> On Indicator State Changed -> switch on New State: Available shows the dot, Locked shows the dot + ring.
C++ override points
State visuals are authored in the Blueprint widget (On Indicator State Changed is a Blueprint event). In C++ you override the BlueprintNativeEvents Update Screen Position (edge-clamping / off-screen arrows) and Update Distance Scale (custom falloff) instead.
Verify
Lock onto a target: it shows the Locked indicator (and one per lock point); other candidates show the soft Available marker.

4. Tune when the soft markers show

The locked target always shows its indicators; the soft Available markers on other candidates are gated by the config and a runtime switch:

SettingWhereEffect
bShowAvailableIndicatorsUCrimsonLockOnConfigMaster switch for the soft Available markers (default on).
bOnlyShowAvailableWhileLockedUCrimsonLockOnConfigOff by default. When on, markers only appear while you are locked on - so nothing shows until your first lock-on, and they hide again on release.
IndicatorRefreshIntervalUCrimsonLockOnConfigSeconds between candidate re-scans (default 0.2).
SetIndicatorsEnabled(bool)UCrimsonLockOnComponent (runtime)Toggle the soft markers live - e.g. show them only while aiming.
One marker per candidate, one per bone when locked
An un-locked candidate shows a single collapsed Available marker at its default point. When you lock a target it expands to one indicator per lock point - the active point Locked, the rest Available - so you can see the weak points you can cycle to, then collapses back on release.
Keep a steady on-screen size
A fixed-pixel widget looks oversized at range. The widget's DistanceScaleMode (ClampedLinear, Curve, or None) scales it down with camera distance so it holds a roughly constant apparent size against the target.
Verify
With bOnlyShowAvailableWhileLocked on, the soft markers appear only after your first lock-on and hide again on release; toggling SetIndicatorsEnabled(false) hides them live.

See also

  • Concept: Lock-On Pipeline - how targeting, the component, and the camera mode fit together.
  • Lock-On Reference (in API Reference) - the indicator widget, settings, and config flags.