How-To: Settings-Driven Modifiers

Goal: drive deadzone, gamepad sensitivity, aim inversion, and property-based scaling from each player's settings, without the input system importing any concrete settings class.

Prerequisites
A ULocalPlayer subclass you can edit, and (for UCrimsonSettingBasedScalar) a settings object that holds the scalar values.

1. Implement the settings provider on your local player

All four modifiers find their values by casting the local player to ICrimsonInputSettingsProvider, so you implement that interface on your local player class. ULocalPlayer itself is not Blueprintable - for a Blueprint provider, subclass UCrimsonCommonLocalPlayer (CrimsonInput's CrimsonCommon dependency ships it, and it is Blueprintable) and override the K2_ events. In C++ you subclass ULocalPlayer (or UCrimsonCommonLocalPlayer) and override the C++ virtuals for zero overhead - the virtuals fall through to the K2_ events, so either path reaches the modifiers.

Content Browser -> Blueprint Class -> parent = Crimson Common Local Player. Open it -> Class Settings -> Interfaces -> Add -> Crimson Input Settings Provider. Then override the K2_ events (K2 Get Gamepad Look Stick Dead Zone, K2 Get Invert Vertical Axis, ...) to return your saved settings.
Parent must be Blueprintable
You cannot pick ULocalPlayer as the Blueprint parent - it is not Blueprintable. Use Crimson Common Local Player (Blueprintable), available because CrimsonInput depends on CrimsonCommon.

Then point the engine at your class in Config/DefaultEngine.ini:

ini
[/Script/Engine.Engine]
LocalPlayerClassName=/Script/MyGame.MyLocalPlayer

Then set your Blueprint local player as the Local Player Class in Config/DefaultEngine.ini. A Blueprint class path needs the _C suffix:

ini
[/Script/Engine.Engine]
LocalPlayerClassName=/Game/Player/BP_MyLocalPlayer.BP_MyLocalPlayer_C
Verify
Cast<ICrimsonInputSettingsProvider>(GetLocalPlayer()) is non-null at runtime; if it is null, the modifiers pass input through unchanged (they no-op without a provider).

2. Add the modifiers to your input actions

Add the modifier(s) to a UInputAction's Modifiers array (or to a mapping). They evaluate per frame, reading the provider each time.

InputAction Details -> Modifiers -> + -> Crimson Settings Driven Dead Zone (and/or the sensitivity, inversion, and setting-based-scalar modifiers). Set per-modifier options like Deadzone Stick.
ModifierReads from providerOptions
UCrimsonInputModifierDeadZoneGetGamepadMoveStickDeadZone or ...LookStickDeadZoneType (Radial/Axial), UpperThreshold, DeadzoneStick (Move/Look)
UCrimsonInputModifierGamepadSensitivityGetGamepadLookSensitivityPreset or ...TargetingSensitivityPresetTargetingType (Normal/ADS), SensitivityLevelTable
UCrimsonInputModifierAimInversionGetInvertVerticalAxis, GetInvertHorizontalAxisnone - inverts X and/or Y per flags
UCrimsonSettingBasedScalarGetSharedSettingsObject (named float/double properties)X/Y/ZAxisScalarSettingName, Min/MaxValueClamp
Verify
Changing a value on your settings object changes the felt input live - e.g. raising the look deadzone shrinks small-stick response; toggling invert-Y flips vertical look.
Full stack implements this for you; standalone you implement it
On the full Crimson stack, CrimsonCore's UCrimsonCoreLocalPlayer already implements ICrimsonInputSettingsProvider and forwards every value to the player's UCrimsonSettingsShared (deadzone, sensitivity presets, invert), so the modifiers respond to saved settings with no work from you. This page is for standalone use (CrimsonInput without CrimsonCore), where you implement the provider yourself as shown above. GetSharedSettingsObject returns null by default, so UCrimsonSettingBasedScalar does nothing until your provider returns a settings object. See Concept: The Settings-Provider Bridge.

See also

  • How-To: Gamepad Aim Sensitivity - build the sensitivity table the sensitivity modifier reads.
  • Concept: The Settings-Provider Bridge - how modifiers discover the provider and why it decouples input from settings.