Logo: Ue Enhanced Input

Ue Enhanced Input

Communautéit
kevinpbuckley
ue-enhanced-input

Implement player input with Unreal's Enhanced Input system — UInputAction (data asset, value types Boolean/Axis1D/Axis2D/Axis3D), UInputMappingContext (key-to-action mappings with per-key modifiers and triggers), UEnhancedInputComponent (BindAction with ETriggerEvent), UEnhancedInputLocalPlayerSubsystem (AddMappingContext/RemoveMappingContext), UInputModifier (Negate, SwizzleAxis, DeadZone, Scalar, Smooth), UInputTrigger (Pressed, Released, Hold, Tap, Pulse, ChordedAction), FInputActionValue (Get<bool>(), Get<float>(), Get<FVector2D>(), Get<FVector>()), and PlayerController/Pawn setup. Use when setting up player controls, binding movement/look/jump/interact actions in C++, adding or swapping mapping contexts at runtime (on-foot vs. in-vehicle vs. menu), reading analog values, or migrating from legacy BindAxis/BindAction input.

Iwwersiicht

Editeurkevinpbuckley
Repositoryunreal-engine-skills
Skill-Nummue-enhanced-input
Stären
89
Forks
9
Matgeliwwert Dateien
3
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 3 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    kevinpbuckley huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Ue Enhanced Input an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/kevinpbuckley/unreal-engine-skills/tree/master/skills/core/ue-enhanced-input
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/kevinpbuckley/unreal-engine-skills.git /tmp/unreal-engine-skills
mkdir -p .claude/skills
cp -r /tmp/unreal-engine-skills/skills/core/ue-enhanced-input .claude/skills/ue-enhanced-input
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Ue Enhanced Input an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Ue Enhanced Input automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Ue Enhanced Input net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Enhanced Input

Enhanced Input is the modern UE input system. It is data-driven: Input Actions define what a player can do, Input Mapping Contexts map physical keys to actions (with optional modifiers and triggers on each mapping), and the Enhanced Input Local Player Subsystem pushes and pops contexts at runtime. Legacy DefaultInput.ini axis/action mappings still compile but are deprecated and should be avoided in new code.

When to use this skill

  • Setting up player controls on a Pawn, Character, or PlayerController.
  • Binding movement, look, jump, interact, or any other player action in C++.
  • Adding, removing, or reprioritizing mapping contexts at runtime (context switching: on-foot, in-vehicle, UI, etc.).
  • Reading analog values from FInputActionValue in an action handler.
  • Replacing legacy BindAxis/BindAction input bindings.

Mental model

Physical key press
   → IMC mapping (modifiers applied first, triggers evaluated)
   → FInputActionValue delivered to handler on matching ETriggerEvent

The system is entirely data-asset-driven. UInputAction and UInputMappingContext are UDataAsset subclasses created in the Content Browser. C++ code holds UPROPERTY pointers to them and uses the subsystem and component to wire them up.

Setup checklist

  1. Verify the Enhanced Input plugin is enabled (on by default in 5.x new projects).
  2. Add "EnhancedInput" to PrivateDependencyModuleNames in your Build.cs.
  3. Set defaults in Project Settings → Engine → Input:
    • Default Player Input Class → EnhancedPlayerInput
    • Default Input Component Class → EnhancedInputComponent
  4. Create a UInputAction asset per action; set the value type (Boolean, Axis1D, Axis2D, Axis3D).
  5. Create a UInputMappingContext asset; add key→action mappings, plus any per-mapping modifiers/triggers.
  6. On possession/spawn: push the context via the subsystem.
  7. In SetupPlayerInputComponent: cast to UEnhancedInputComponent, call BindAction.

Core types

TypeRole
UInputActionAbstract action data asset; carries a ValueType (EInputActionValueType)
UInputMappingContextData asset mapping FKey → UInputAction, with per-mapping UInputModifier[] and UInputTrigger[]
UEnhancedInputComponentInput component subclass; BindAction registers C++ delegates
UEnhancedInputLocalPlayerSubsystemPer-local-player subsystem; AddMappingContext / RemoveMappingContext
FInputActionValueValue delivered to handlers; Get<T>() extracts bool, float, FVector2D, or FVector
ETriggerEventWhen the handler fires: Started, Triggered, Ongoing, Completed, Canceled

Adding a mapping context

Push contexts from a point where the local player exists — typically APlayerController::BeginPlay or APawn::PawnClientRestart:

cpp
// In AMyPlayerController::BeginPlay or APawn::PawnClientRestart
#include "EnhancedInputSubsystems.h"

if (ULocalPlayer* LP = GetLocalPlayer())  // APlayerController has GetLocalPlayer()
{
    auto* Subsys = LP->GetSubsystem<UEnhancedInputLocalPlayerSubsystem>();
    if (Subsys && DefaultMappingContext)
    {
        Subsys->AddMappingContext(DefaultMappingContext, /*Priority*/ 0);
    }
}

Higher-priority values take precedence when two active contexts map the same key to different actions. Remove with Subsys->RemoveMappingContext(IMC). A context can be added/removed any number of times (e.g. entering/leaving a vehicle).

Binding actions in C++

SetupPlayerInputComponent runs on the Pawn after the input component is created. Cast it to UEnhancedInputComponent (safe once the default class is set in Project Settings):

cpp
// AMyCharacter.h
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "AMyCharacter.generated.h"

class UInputAction;
class UInputMappingContext;
struct FInputActionValue;

UCLASS()
class MYGAME_API AMyCharacter : public ACharacter
{
    GENERATED_BODY()
public:
    virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override;

protected:
    void OnMove(const FInputActionValue& Value);
    void OnLook(const FInputActionValue& Value);

    UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Input")
    TObjectPtr<UInputMappingContext> DefaultMappingContext;

    UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Input")
    TObjectPtr<UInputAction> MoveAction;   // Axis2D

    UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Input")
    TObjectPtr<UInputAction> LookAction;   // Axis2D

    UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Input")
    TObjectPtr<UInputAction> JumpAction;   // Boolean
};
cpp
// AMyCharacter.cpp
#include "AMyCharacter.h"
#include "EnhancedInputComponent.h"
#include "EnhancedInputSubsystems.h"
#include "InputActionValue.h"

void AMyCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
    Super::SetupPlayerInputComponent(PlayerInputComponent);

    // Push mapping context (Pawn path: via controller's local player)
    if (APlayerController* PC = Cast<APlayerController>(GetController()))
    {
        if (ULocalPlayer* LP = PC->GetLocalPlayer())
        {
            auto* Subsys = LP->GetSubsystem<UEnhancedInputLocalPlayerSubsystem>();
            if (Subsys && DefaultMappingContext)
                Subsys->AddMappingContext(DefaultMappingContext, 0);
        }
    }

    auto* EIC = CastChecked<UEnhancedInputComponent>(PlayerInputComponent);

    // Continuous actions use ETriggerEvent::Triggered (fires every tick while held)
    EIC->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AMyCharacter::OnMove);
    EIC->BindAction(LookAction, ETriggerEvent::Triggered, this, &AMyCharacter::OnLook);

    // Jump: Started fires on first press, Completed fires on release
    EIC->BindAction(JumpAction, ETriggerEvent::Started,   this, &ACharacter::Jump);
    EIC->BindAction(JumpAction, ETriggerEvent::Completed, this, &ACharacter::StopJumping);
}

void AMyCharacter::OnMove(const FInputActionValue& Value)
{
    const FVector2D Axis = Value.Get<FVector2D>();  // matches IA_Move's Axis2D type
    AddMovementInput(GetActorForwardVector(), Axis.Y);
    AddMovementInput(GetActorRightVector(),   Axis.X);
}

void AMyCharacter::OnLook(const FInputActionValue& Value)
{
    const FVector2D Delta = Value.Get<FVector2D>();
    AddControllerYawInput(Delta.X);
    AddControllerPitchInput(Delta.Y);
}

Key rules:

  • Action UPROPERTY members are assigned in a Blueprint subclass (or in asset defaults). Assign DefaultMappingContext, MoveAction, etc. via EditAnywhere.
  • CastChecked asserts in Debug builds if the cast fails — a fast failure on misconfiguration.
  • The handler signature must exactly match one of the four overloads: no args, const FInputActionValue&, const FInputActionInstance&, or the dynamic four-param form.
  • BindAction returns a FEnhancedInputActionEventBinding& if you need to remove the binding later; store the handle or use RemoveBindingByHandle.

Reading FInputActionValue

cpp
// Match the value type declared on the UInputAction asset:
bool     bPressed = Value.Get<bool>();
float    Analog   = Value.Get<float>();       // Axis1D
FVector2D Axis2D  = Value.Get<FVector2D>();   // Axis2D
FVector   Axis3D  = Value.Get<FVector>();     // Axis3D

Reading the wrong type silently returns zero (e.g. Get<bool>() on an Axis2D action returns false). The correct type is whatever EInputActionValueType the action asset declares.

Trigger events — choosing the right one

Use caseETriggerEvent
Continuous hold (movement, look, accelerate)Triggered
One-shot on press (jump start, fire, interact)Started
One-shot on release (jump release, confirm UI)Completed
Cancel feedback (abort a hold)Canceled
Every frame while held, before threshold metOngoing

Note: Started fires once on the frame the key passes the actuation threshold. Triggered fires every tick while held. Completed fires the frame the key is released (or the trigger condition is fully met and then ends).

WASD as an Axis2D — modifier pattern

A single IA_Move (Axis2D) action can be driven by four keyboard keys using per-mapping modifiers in the IMC:

KeyModifiers on the mapping
WSwizzle Input Axis Values (YXZ) — moves X→Y so W contributes +Y
SSwizzle (YXZ) + Negate — contributes −Y
ANegate — contributes −X
D(none) — contributes +X (default)

At runtime, Enhanced Input accumulates all active mappings for an action per frame (default TakeHighestAbsoluteValue; Cumulative is the alternative, set on the UInputAction asset).

Gotchas

  • Missing "EnhancedInput" in Build.cs → unresolved symbols for all Enhanced Input classes.
  • Default input classes not set → CastChecked<UEnhancedInputComponent> crashes on start; Cast returns null and nothing fires.
  • Mapping context not added → actions never fire; the subsystem must have the IMC before any key can reach an action.
  • Adding context before local player exists → GetLocalPlayer() returns null; always add from PawnClientRestart/BeginPlay (after possession), not the constructor.
  • Value type mismatch → Get<FVector2D>() on a Boolean action yields (0, 0); align the handler type with the action asset's ValueType.
  • Legacy bind calls on UEnhancedInputComponent → BindAxis/BindAction(FName, ...) are deleted (compile error) unless ENHANCED_INPUT_ALLOW_LEGACY_BINDING=1 in Build.cs.
  • Action fires on context add when key is held → default FModifyContextOptions sets bIgnoreAllPressedKeysUntilRelease = true; the key must be released and re-pressed. Set bIgnoreAllPressedKeysUntilRelease = false to override.
  • Priority conflicts — add 0 for most contexts; reserve higher values for overlay contexts (e.g. UI) that must win over gameplay.

Legacy input (you will still encounter it)

Older projects use DefaultInput.ini axis/action mappings and BindAxis/BindAction(FName, ...) on UInputComponent. These still compile in 5.8 but cannot coexist cleanly with UEnhancedInputComponent (legacy binds are explicitly deleted on the enhanced component by default). Migrate by replacing axis/action map entries with UInputAction + UInputMappingContext assets, and replacing BindAxis/BindAction(FName, ...) calls with UEnhancedInputComponent::BindAction.

Version notes

  • Enhanced Input shipped in UE 4.27 as a plugin and became the default system in UE 5.1. In UE 5.7 the Mappings property on UInputMappingContext is deprecated (marked UE_DEPRECATED(5.7)) in favour of the new DefaultKeyMappings struct; use the editor asset instead of editing the Mappings array in C++.
  • FModifyContextOptions (the options struct for AddMappingContext) and input mode filtering via FGameplayTagContainer are 5.3+ additions.

References & source material

Engine source (UE 5.8, plugin path prefix: Engine/Plugins/EnhancedInput/Source/EnhancedInput/Public/):

  • InputAction.h — UInputAction:55 (UDataAsset subclass), EInputActionValueType (InputActionValue.h:10, Boolean/Axis1D/Axis2D/Axis3D), EInputActionAccumulationBehavior:24, FInputActionInstance:207 (GetValue():259, GetTriggerEvent():256).
  • InputActionValue.h — FInputActionValue:23; Get<bool>():205, Get<float>():212, Get<FVector2D>():218, Get<FVector>():224; EInputActionValueType reused here.
  • InputMappingContext.h — UInputMappingContext:87 (UDataAsset subclass); DefaultKeyMappings:101 (5.7 replacement for deprecated Mappings).
  • EnhancedInputComponent.h — UEnhancedInputComponent:373; BindAction template macro DEFINE_BIND_ACTION:480 (four signature overloads); BindActionValue:553; RemoveBinding:475; BindActionInstanceLambda:539.
  • EnhancedInputSubsystems.h — UEnhancedInputLocalPlayerSubsystem:21 (ULocalPlayerSubsystem + IEnhancedInputSubsystemInterface); AddMappingContext:37; RemoveMappingContext:38.
  • EnhancedInputSubsystemInterface.h — IEnhancedInputSubsystemInterface:103; FModifyContextOptions:47 (bIgnoreAllPressedKeysUntilRelease, bForceImmediately, bNotifyUserSettings); HasMappingContext:368; ClearAllMappings:256.
  • InputTriggers.h — ETriggerEvent:34 (None/Triggered/Started/Ongoing/ Canceled/Completed); UInputTrigger:113 (ActuationThreshold:130); concrete triggers: UInputTriggerPressed:279, UInputTriggerReleased:298, UInputTriggerHold:318 (HoldTimeThreshold:334), UInputTriggerTap:365, UInputTriggerPulse:457, UInputTriggerChordAction:494.
  • InputModifiers.h — UInputModifier:16 (ModifyRaw_Implementation); concrete modifiers: UInputModifierDeadZone:170, UInputModifierNegate:253, UInputModifierSwizzleAxis:412 (EInputAxisSwizzle::YXZ), UInputModifierScalar:213, UInputModifierSmooth:275, UInputModifierResponseCurveExponential:306.
  • EnhancedActionKeyMapping.h — FEnhancedActionKeyMapping:37 (Action, Key, Modifiers[], Triggers[]).
  • EnhancedInputDeveloperSettings.h — UEnhancedInputDeveloperSettings:43 (DefaultMappingContexts, bEnableInputModeFiltering, DefaultInputMode).

Official docs (UE 5.8):

Deep-dive references in this skill:

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Ue Enhanced Input?

Implement player input with Unreal's Enhanced Input system — UInputAction (data asset, value types Boolean/Axis1D/Axis2D/Axis3D), UInputMappingContext (key-to-action mappings with per-key modifiers and triggers), UEnhancedInputComponent (BindAction with ETriggerEvent), UEnhancedInputLocalPlayerSubsystem (AddMappingContext/RemoveMappingContext), UInputModifier (Negate, SwizzleAxis, DeadZone, Scalar, Smooth), UInputTrigger (Pressed, Released, Hold, Tap, Pulse, ChordedAction), FInputActionValue (Get<bool>(), Get<float>(), Get<FVector2D>(), Get<FVector>()), and PlayerController/Pawn setup. Use...

Firwat Ue Enhanced Input op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Ue Enhanced Input besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Ue Enhanced Input an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/kevinpbuckley/unreal-engine-skills/tree/master/skills/core/ue-enhanced-input an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Ue Enhanced Input benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Ue Enhanced Input benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Ue Enhanced Input domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Ue Enhanced Input gratis?

kevinpbuckley huet de Skill op GitHub publizéiert. Kuckt am Repository no de Lizenzbedéngungen. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇