Course contentsShow
← Unreal Engine Game Development
Lesson 230 of 8804. Advanced Input and PhysicsFree lesson

Processing Input Value Modifiers

You will apply built-in modifiers like dead zones, swizzling, and scalar multiplication to transform raw input data into usable game values.

In this lesson, you will learn how to refine raw controller data using Input Modifiers to ensure your game logic receives clean, predictable values.

When a player pushes an analog stick or triggers an input, the raw data is rarely perfect. It might be jittery, oriented incorrectly, or too sensitive. Instead of manually cleaning this data inside your C++ tick functions or event handlers, Unreal’s Enhanced Input system allows you to apply "Modifiers" directly within your Input Mapping Context (IMC).

Why use Modifiers?

Modifiers act as a pre-processing pipeline for your input data. They sit between the physical hardware and your code, transforming the signal before it reaches your logic.

Three common modifiers you should master include:

  1. Dead Zone: This discards small, accidental movements (like a stick that doesn't perfectly center to 0.0). It creates a "buffer" where input is ignored, preventing character drift.
  2. Swizzle: Sometimes, your input data arrives in the wrong coordinate space. A Swizzle modifier lets you reorder or negate your axes—for example, converting an X-axis movement into a Y-axis value to align controller orientation with your game world.
  3. Scalar: This is a simple multiplier. If a specific player finds a vehicle’s steering too sensitive, you can apply a scalar (e.g., 0.5) to dampen the input intensity without changing your underlying movement code.

Applying Modifiers in the Editor

While you can implement these in code, you will primarily configure these in the Input Mapping Context asset. Each action you bind will have an "Modifiers" array. By clicking the plus icon, you can stack these operations.

For example, if you add a Dead Zone followed by a Scalar, the engine processes them in order: the stick drift is removed first, and then the remaining magnitude is multiplied to give you your final game value.

// Example: Modifiers transform the FInputActionValue 
// passed into your delegate binding:
void AMyCharacter::Move(const FInputActionValue& Value)
{
    // By the time this function triggers, the value has already 
    // been processed by your defined Modifiers.
    FVector2D MovementVector = Value.Get<FVector2D>();
    AddMovementInput(GetActorForwardVector(), MovementVector.Y);
}

By leveraging these modifiers, you keep your game code clean and decoupled from hardware-specific quirks.

Key Takeaway: Use Input Modifiers to sanitize and scale raw hardware input at the mapping level, keeping your character logic clean and hardware-agnostic.