How-To: Gamepad Aim Sensitivity
Goal: offer named gamepad sensitivity presets (Slow ... Insane) that map to real scalar multipliers, with a separate value for aiming down sights.
UCrimsonInputModifierGamepadSensitivity to your look action and implemented ICrimsonInputSettingsProvider (see How-To: Settings-Driven Modifiers).1. Create the sensitivity data asset
UCrimsonAimSensitivityData is a Const primary data asset holding a TMap<ECrimsonGamepadSensitivity, float>. Content Browser -> right-click -> Miscellaneous -> Data Asset, pick Crimson Aim Sensitivity Data, and fill SensitivityMap with one row per preset you expose. The key dropdown lists them numbered, so they sort in feel order: 01 - Slow -> 0.5, 04 - Normal -> 1.0, 10 - Insane -> 2.5, and so on. One asset per project is enough.
ECrimsonGamepadSensitivity preset you added, each with a float multiplier.2. Assign it and pick the default preset
On the UCrimsonInputModifierGamepadSensitivity, set SensitivityLevelTable to your asset and set TargetingType: Normal reads the player's look preset, ADS reads the targeting preset - so hip-fire and aim can scale differently from one look action or two. Leave the table unset and the modifier passes input through untouched and warns once in LogCrimsonInput, so a forgotten assignment shows up in the log instead of as a settings screen that quietly does nothing.
// The modifier resolves the scalar each frame (from ICrimsonInputSettingsProvider):const bool bUseTargeting = HasAbilitySystemTag(PlayerInput, AimingStateTag)|| TargetingType != ECrimsonTargetingType::Normal;const ECrimsonGamepadSensitivity Preset = bUseTargeting? Provider->GetGamepadTargetingSensitivityPreset(): Provider->GetGamepadLookSensitivityPreset();const float Scalar = SensitivityLevelTable->SensitivityEnumToFloat(Preset);
ECrimsonGamepadSensitivity (Input/CrimsonSensitivityTypes.h) is what you show in the options menu - 10 named steps. The float it maps to is authored per project in the data asset, so tuning feel never touches code or the settings UI.3. Switch to the aim preset only while aiming
A fixed TargetingType means one mapping, one preset. If the same look action serves both hip-fire and aiming, set AimingStateTag instead: while the pawn's ability system owns that tag the targeting preset wins, and the moment it is removed the look preset takes over again. Use whatever tag your aim ability or aim state already grants - the modifier resolves the ability system through Epic's IAbilitySystemInterface on the possessed pawn, so nothing needs to call into the modifier.
AimingStateTag unset and behavior is unchanged: TargetingType alone decides.See also
- How-To: Settings-Driven Modifiers - the provider that supplies the current preset.
- API Reference -
UCrimsonAimSensitivityData,ECrimsonGamepadSensitivity,ECrimsonTargetingType,AimingStateTag.