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.
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.
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:
[/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:
[/Script/Engine.Engine]LocalPlayerClassName=/Game/Player/BP_MyLocalPlayer.BP_MyLocalPlayer_C
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.
| Modifier | Reads from provider | Options |
|---|---|---|
UCrimsonInputModifierDeadZone | GetGamepadMoveStickDeadZone or ...LookStickDeadZone | Type (Radial/Axial), UpperThreshold, DeadzoneStick (Move/Look) |
UCrimsonInputModifierGamepadSensitivity | GetGamepadLookSensitivityPreset or ...TargetingSensitivityPreset | TargetingType (Normal/ADS), SensitivityLevelTable |
UCrimsonInputModifierAimInversion | GetInvertVerticalAxis, GetInvertHorizontalAxis | none - inverts X and/or Y per flags |
UCrimsonSettingBasedScalar | GetSharedSettingsObject (named float/double properties) | X/Y/ZAxisScalarSettingName, Min/MaxValueClamp |
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.