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, add a one-line C++ subclass UCLASS(Blueprintable) class UMyLocalPlayer : public ULocalPlayer (or use any Blueprintable local player your project already has), make a Blueprint of it and override the K2_ events. In C++ you subclass ULocalPlayer and override the C++ virtuals for zero overhead - the virtuals fall through to the K2_ events, so either path reaches the modifiers.

Content Browser -> right-click -> Blueprint Class -> All Classes, search for your Blueprintable local player class, and create the Blueprint. Open it and go to Class Settings -> Details -> Interfaces -> Add -> Crimson Input Settings Provider. In My Blueprint -> Interfaces, double-click each event you want to answer - K2 Get Gamepad Move Stick Dead Zone, K2 Get Gamepad Look Stick Dead Zone, K2 Get Gamepad Look Sensitivity Preset, K2 Get Gamepad Targeting Sensitivity Preset, K2 Get Invert Vertical Axis, K2 Get Invert Horizontal Axis - and wire each Return Node to the matching value on your saved settings object. Events you leave unimplemented return the interface's defaults, and the modifier simply passes input through.

Parent must be Blueprintable
You cannot pick ULocalPlayer as the Blueprint parent - it is not Blueprintable. Use a C++ subclass marked UCLASS(Blueprintable) (one line of code, see the paragraph above), then set Local Player Class in Project Settings to your Blueprint.

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. Use the path the Content Browser's Copy Reference gives you for that Blueprint, and append the _C suffix a Blueprint class path needs:

ini
[/Script/Engine.Engine]
LocalPlayerClassName=<copied reference to your local player Blueprint>_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. In the picker they appear as Crimson Settings Driven Dead Zone, Crimson Gamepad Sensitivity, Crimson Aim Inversion Setting, and Crimson Setting Based Scalar.

ModifierReads from providerOptions
UCrimsonInputModifierDeadZoneGetGamepadMoveStickDeadZone or ...LookStickDeadZoneType (Radial/Axial), UpperThreshold, DeadzoneStick (Move/Look)
UCrimsonInputModifierGamepadSensitivityGetGamepadLookSensitivityPreset or ...TargetingSensitivityPresetTargetingType (Normal/ADS), SensitivityLevelTable, AimingStateTag
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
(CrimsonCore - requires all Crimson plugins.) CrimsonCore's UCrimsonCoreLocalPlayer already implements ICrimsonInputSettingsProvider and forwards every value (deadzone, sensitivity presets, invert) to its saved settings object, so the modifiers respond to the player's settings with no work from you. This page is the standalone equivalent, 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.