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 center 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 class. This is the project-wide fallback used by every lockable actor.

To change a single actor instead of the whole project, select its Crimson Lock On Target Component and set Details -> Lock-On | Indicator -> Indicator Widget Class Override to your widget, leaving it unset everywhere else. Clearing Show Indicator in the same category turns that actor's indicator off entirely.

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 (centered on the lock point) and distance scaling are handled for you.

Reference implementation
Open the shipped W_CrimsonCamera_LockOnIndicator (/CrimsonCamera/UserInterface/) - it is exactly this step, built. A SizeBox wraps one Image named IMG_LockOnIndicator whose brush uses M_CrimsonCamera_LockOnIndicator_Inst; Event Construct pulls a dynamic material instance off that image into a MID_LockOnIndicator variable, and On Indicator State Changed switches on the new state to drive the material's DotOpacity and RingOpacity scalars. Duplicate it as your starting point. Plugin content is hidden in the Content Browser until you tick Show Plugin Content in its Settings menu.

Building your own: Event Construct -> Get Dynamic Material (Target = your indicator Image) -> Set a Material Instance Dynamic variable. Then right-click the Event Graph and add Event On Indicator State Changed (it is listed under Lock-On, because your widget derives UCrimsonLockOnIndicatorWidget) -> Switch on ECrimsonLockOnIndicatorState (Selection = New State). The switch gives you a pin per ECrimsonLockOnIndicatorState value: wire Available and Locked to the two visuals above, Hidden to hiding both, and SoftTarget only if you also use soft lock-on. Each branch drives your visibility, or a Set Scalar Parameter Value on the stored material instance.

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. Both scaling modes clamp the result to MinScale/MaxScale, so widen MaxScale if a curve should grow the indicator past its authored size.
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.