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.
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.
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.
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.
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.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.
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.
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.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:
| Setting | Where | Effect |
|---|---|---|
bShowAvailableIndicators | UCrimsonLockOnConfig | Master switch for the soft Available markers (default on). |
bOnlyShowAvailableWhileLocked | UCrimsonLockOnConfig | Off 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. |
IndicatorRefreshInterval | UCrimsonLockOnConfig | Seconds between candidate re-scans (default 0.2). |
SetIndicatorsEnabled(bool) | UCrimsonLockOnComponent (runtime) | Toggle the soft markers live - e.g. show them only while aiming. |
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.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.