Why the Enhanced Input System is Needed
The legacy input system (Action Mapping and Axis Mapping) used up to Unreal Engine 4 (UE4) worked well for simple games, but as projects scaled up and input types and supported devices increased, several challenges became apparent.
Main challenges with the legacy input system:
- Management Complexity: All input settings were centralized in project settings files, requiring searching through all settings to find which keys were assigned to specific inputs (e.g., "Jump").
- Difficulty Switching Contexts: When players switch from "walking mode" to "driving mode," dynamically changing input settings was cumbersome. Manually unbinding and rebinding inputs in code was error-prone.
- Lack of Flexibility: Implementing complex input conditions like hold, double-tap, or simultaneous presses required complex logic in Blueprint or C++.
Enhanced Input System introduced in Unreal Engine 5 (UE5) is a more flexible and powerful input management framework designed to solve these challenges.
Main Components of the Enhanced Input System
The Enhanced Input System mainly consists of three assets and one component.
| Component Name | Role | Legacy System Equivalent |
|---|---|---|
| Input Action (IA) | Defines abstract actions the player wants to perform (e.g., jump, move, attack). Independent of input devices. | Action Mapping / Axis Mapping |
| Input Mapping Context (IMC) | Defines which input devices (keyboard Space key, gamepad A button, etc.) map to which Input Actions. | Project Settings Input section |
| Input Trigger & Modifier | Defines input action activation conditions (hold, double-tap, etc.) and input value processing (dead zone, axis inversion, etc.). | Didn't exist in legacy system |
| Enhanced Input Component | Component attached to Pawns like player characters to apply IMCs and receive IA events. | Legacy Input Component |
Key Point: IA separates "what you want to do" and IMC separates "how to do it." This dramatically simplifies input settings management.
Enhanced Input System Implementation Steps
Here we explain the steps to implement basic character movement settings in Blueprint.
Step 1: Create Input Actions (IA)
Create two IAs needed for movement.
- Right-click in Content Browser and select
Input->Input Action. - Create
IA_Moveto receive movement direction input.- Set
Value TypetoAxis2D (Vector2). This receives input in two directions: X-axis (left/right) and Y-axis (forward/back).
- Set
- Create
IA_Jumpfor jumping.- Set
Value TypetoDigital (Bool).
- Set
Step 2: Create Input Mapping Context (IMC)
Next, assign actual keys to the created IAs.
- Right-click in Content Browser and select
Input->Input Mapping Context, creatingIMC_PlayerControls. - Open
IMC_PlayerControlsand add mappings with+ Mapping.
| Input Action | Key / Button | Modifiers |
|---|---|---|
IA_Move | W (Keyboard) | Swizzle Input Axis (YXZ) |
IA_Move | S (Keyboard) | Negate |
IA_Move | D (Keyboard) | Swizzle Input Axis (YXZ) |
IA_Move | A (Keyboard) | Negate + Swizzle Input Axis (YXZ) |
IA_Jump | Space Bar (Keyboard) | None |
💡 Modifiers Explained:
IA_Moveexpects Vector2, but keyboard W/S/A/D only output a single axis (Float).- W/S needs to map to Y-axis (forward/back), A/D to X-axis (left/right).
Swizzle Input AxisModifiers convert W/S input to Y-axis and A/D input to X-axis.NegateModifiers invert input values for S key (backward) and A key (left movement).
Step 4: Apply IMC to Player Character
Open the player character Blueprint (e.g., BP_ThirdPersonCharacter) and apply IMC in Event BeginPlay.
// BP_ThirdPersonCharacter (Event Graph)
// 1. Get Player Controller
// 2. Get Subsystem node - select EnhancedInputLocalPlayerSubsystem
// 3. Add Mapping Context (Target: Subsystem, Context: IMC_PlayerControls, Priority: 0)
💡 Getting Enhanced Input Subsystem
Enhanced Input Subsystem is a type of Local Player Subsystem. There is no "Cast to Enhanced Input Player Controller" node. Instead, use the
Get Subsystemnode and specifyEnhancedInputLocalPlayerSubsystemas the subsystem class. After getting the Player Controller, connecting a Get Subsystem node retrieves the Subsystem instance associated with that player.
Step 5: Handle Input Action Events
Finally, handle IA events to move the character.
// BP_ThirdPersonCharacter (Event Graph)
// IA_Move event handling
// 1. Search for IA_Move in Enhanced Input Action Events
// 2. Call Add Movement Input node from Triggered pin
// 3. Break Action Value (Vector2) with Break Vector 2D
// 4. Connect X-axis value to Get Right Vector, Y-axis value to Get Forward Vector, each to Add Movement Input's World Direction
// 5. Connect X-axis/Y-axis values to Add Movement Input's Scale Value
// IA_Jump event handling
// 1. Search for IA_Jump in Enhanced Input Action Events
// 2. Call Jump node from Triggered pin
// 3. Call Stop Jumping node from Completed pin
Triggers and Modifiers
The true value of Enhanced Input lies in Triggers (activation conditions) and Modifiers (input value processing). Combining these lets you define complex input logic in assets without building it in Blueprint or C++.
Input Triggers (Activation Conditions) Examples
| Trigger | Description | Use Case |
|---|---|---|
| Held | Activates when key is held for a certain time or longer. | Skill charging, hold-to-show menu. |
| Tap | Activates when key is quickly pressed and released. | Double-tap dash, quick actions. |
| Chord | Activates when multiple keys are pressed simultaneously. | L1+R1 combo commands. |
| Down | Activates the moment key is pressed (similar to legacy Action Mapping). | Normal attack, jump. |
Input Modifiers (Input Value Processing) Examples
| Modifier | Description | Use Case |
|---|---|---|
| Dead Zone | Sets stick dead zone to ignore unintended input. | Gamepad stick operation. |
| Negate | Inverts input value (e.g., 1.0 to -1.0). | Backward movement, Y-axis inversion for camera. |
| Swizzle Input Axis | Swaps input vector axes (e.g., swap X and Y). | Mapping keyboard W/S/A/D input to Vector2. |
| Smooth | Adds smoothness to input values, softening sudden input changes. | Camera acceleration/deceleration. |
Best Practices and Common Mistakes
✅ Best Practice: Utilizing Contexts
The biggest advantage of Enhanced Input is dynamically switching IMCs.
- Split IMCs: Split IMCs by game context like "
IMC_PlayerControls(basic controls)," "IMC_Driving(driving controls)," "IMC_UI(menu controls)." - Priority Settings: When multiple IMCs are active simultaneously (e.g., can operate UI while driving), set priorities in
Add Mapping Contextnode to prevent conflicts. Higher priority IMC mappings take precedence.
❌ Common Mistake: Incorrect Input Action Value Type
If Value Type isn't set appropriately when creating IAs, you won't get intended input values.
- Digital (Bool): Binary on/off input (keyboard keys, buttons) like jump, attack.
- Axis1D (Float): Single-axis continuous value input like throttle, triggers.
- Axis2D (Vector2): Two-axis continuous value input like movement, camera control.
When assigning keyboard W key to an Axis2D IA, W key outputs a Float value (1.0). To map this to Vector2's Y-axis, the Swizzle Input Axis Modifier mentioned earlier is essential. Forgetting this Modifier causes input to not work.
Key Points for Enhanced Input System Usage
Unreal Engine 5's Enhanced Input System is a powerful framework that fundamentally solves legacy input system problems like management complexity and lack of flexibility.
- Input Action (IA) abstracts "what you want to do," Input Mapping Context (IMC) separates "how to do it."
- Using Triggers and Modifiers easily defines complex input logic on the asset side.
- Dynamically switching IMCs easily achieves context-appropriate input management.
For UE5 game development, mastering the Enhanced Input System is the key to building comfortable, maintainable input systems. Be sure to use it in your projects.