How-To: Add Soft Lock-On

Goal: enable action-combat soft lock-on (Black Desert / Aion-style). The camera stays fully player-controlled, and whenever you are not hard-locked the system continuously tracks the screen-centre-most valid enemy and exposes it so your attacks can face / home toward it.

Prerequisites
You completed How-To: Set Up Lock-On (a pawn with a UCrimsonLockOnComponent and a UCrimsonLockOnConfig whose targeting preset selects candidates). Soft lock gathers through that preset by default - but read the callout below first: soft needs a preset that culls what's behind the camera.
Hard lock always wins
Soft lock is dormant while a hard lock is held: it never evaluates, holds a target, or nudges the camera during a hard lock, and Toggle Lock On commits the current soft target instantly. Soft resumes when the hard lock is released.
Give soft lock a preset that culls behind you
Soft tracking is continuous and sticky, so - unlike hard lock, which is shielded from behind-camera picks by only ever taking the front-most sorted result - its preset must include a Crimson Lock-On Filter: Frontal Cone (Reference Direction = Camera View), or it will acquire and stick to enemies behind the camera. Either add that filter to the config's TargetingPreset (soft reuses it), or author a dedicated UCrimsonLockOnConfig -> SoftTargetingPreset (its own, typically tighter cone) - when set, soft gathers through it instead of the hard preset. Keep the filter's Require In Front Of Source on (default): with Camera View the cone apex is the camera, so this half-space test also culls targets beside/behind the player that still sit inside the camera's cone. The Preset tab of Crimson.Camera.DevTools flags a soft preset that is missing this filter.

1. Enable it (per project)

Soft lock is opt-in. Turn it on and tune the feel under Project Settings -> Crimson -> Crimson Camera -> Soft Lock-On.

Project Settings -> Crimson -> Crimson Camera -> Soft Lock-On: Enable Soft Lock-On, then tune stickiness, range, and the indicator.
SettingEffect
bEnableSoftLockMaster gate. Off by default - nothing tracks until a developer opts in.
SoftStickinessScoreMarginHow much better a challenger must score (0..1 screen-centre proximity) before it steals the current soft target. Higher = stickier.
SoftMinDwellTimeMinimum seconds the current soft target is held before any switch (a target that leaves the cone/range drops immediately regardless).
SoftLockMaxDistanceRange cap (cm); 0 reuses the config's MaxLockDistance.
SoftLockRefreshIntervalSeconds between re-evaluations (the target is not recomputed every frame).
bShowSoftTargetIndicatorShow a light marker on the current soft target so the player can tell who they'll hit (drives the widget's new SoftTarget state).
Why stickiness matters
Without hysteresis a soft target flickers between enemies frame-to-frame - the number-one complaint about soft-lock systems. The margin + dwell hold the current pick until another is clearly better, which is what makes it feel good.

2. Consume the target in gameplay

The camera plugin only exposes the target; turning the character or homing an attack is gameplay. Query Get Current Lock On Target - it returns the hard target if locked, otherwise the soft target - as an FCrimsonLockOnTargetInfo (actor + bone component + socket + world location + bIsHardLock).

On your attack ability / actor, call Get Current Lock On Target on the UCrimsonLockOnComponent, branch on the return bool, then use World Location (motion-warp / homing) or Target Actor (rotate to face). Subscribe to On Soft Target Changed to react when the pick changes.

On the full stack it's one checkbox
UCrimsonCoreGameplayAbility exposes Get Current Lock On Target and Face Current Lock On Target, plus per-ability Face Lock On Target On Activate / Face Soft Targets - tick them and the character snaps to face the current lock-on target as the ability activates. For smooth facing, drive Motion Warping from the returned world location instead.

3. (Optional) Gentle camera assist

By default the camera is untouched (authentic action-combat feel). To add a subtle assist that keeps the soft target loosely framed, set SoftLockCameraBehavior to Gentle Camera Assist, make a Blueprint child of UCrimsonCameraMode_SoftLockOn, assign it to SoftLockCameraModeClass, and give it a SoftLockCameraOwnerTag distinct from your hard-lock CameraOwnerTag.

It never fights the stick
The assist starts from the control rotation the player already produced this frame and only adds a small, rate-capped nudge once the target drifts past DeadzoneAngleDeg - and only toward the deadzone edge. A player pushing the stick always wins. Tune DeadzoneAngleDeg, SoftBiasInterpSpeed, and MaxBiasDegreesPerSec on the mode.
Use a distinct owner tag
The assist mode is pushed on the camera override stack under SoftLockCameraOwnerTag. If it matches your hard-lock CameraOwnerTag the two collide - the plugin refuses to push it and logs a warning. Give soft lock its own tag (e.g. Camera.Mode.SoftLockOn).
Verify
With soft lock enabled and two enemies on screen, the soft marker sits on the one nearest screen centre; sweeping the camera across them switches only after the margin + dwell (no flicker), and an enemy leaving the cone/range drops it. Pressing lock-on hard-locks the current soft target with no jump. Debug it live with Crimson.Camera.DevTools: the Lock-On tab shows soft state and what Get Current Lock On Target resolves to (HARD vs SOFT), the Targets tab adds a per-actor Soft column plus a magenta soft-target debug draw, and the Preset tab inspects the soft preset side-by-side with the hard one.

See also

  • How-To: Set Up Lock-On - the hard lock-on this builds on.
  • Concept: Lock-On Pipeline - targeting, hard vs soft, and how they interact.
  • Lock-On Reference (in API Reference) - the soft API, the info struct, and the settings.