gamedev-skills/awesome-gamedev-agent-skills

unreal-enhanced-input

Set up player input in Unreal Engine 5 with Enhanced Input: Input Actions, Input Mapping Contexts, modifiers and triggers, adding the mapping context, and binding actions by ETriggerEvent.

소스 보기
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

Unreal Enhanced Input

Wire player input the modern UE5 way with the Enhanced Input system: data-driven Input Actions and Mapping Contexts instead of the legacy Project Settings axis/action mappings. Targets UE 5.8 (Enhanced Input is the default; legacy input is deprecated).

When to use

  • Use when adding movement/look/jump/fire input, creating Input Action (IA_) and Input

Mapping Context (IMC_) assets, applying modifiers/triggers, adding a mapping context to a player, or binding actions in C++ or Blueprints.

  • Use when the project has IA_*/IMC_* assets or references EnhancedInput.

When not to use: engine-agnostic input architecture* (rebinding strategy, buffering, multi-device design) → input-systems. The Pawn/Character C++ those bindings live in → unreal-cpp-gameplay.

Core workflow

  1. Enable the module/plugin. Enhanced Input is on by default in UE5; for C++ binding add

"EnhancedInput" to PublicDependencyModuleNames in *.Build.cs.

  1. Create Input Actions (`IA_`). Each has a Value Type: Digital (bool) for buttons,

Axis1D (float) for triggers, Axis2D (Vector2D) for movement/look.

  1. Create an Input Mapping Context (`IMC_`) that maps keys/buttons to those actions. Use

Modifiers to shape raw input (Negate, Swizzle Input Axis Values, Dead Zone) — e.g. WASD into one Axis2D needs Negate on A/S and a Swizzle on W/S. Use Triggers (Pressed, Hold, Tap) to decide when an action fires.

  1. Add the mapping context to the player via the EnhancedInputLocalPlayerSubsystem

(AddMappingContext(IMC, Priority)), usually in BeginPlay/possession.

  1. Bind actions to handlers by ETriggerEvent (Triggered, Started, Completed, …) on

the EnhancedInputComponent, and read the FInputActionValue in the handler.

  1. Verify in PIE; the Enhanced Input debugging console commands

(showdebug enhancedinput) show which actions trigger and their values.

Patterns

1. Add the mapping context (C++ Character)

cpp
void AMyCharacter::BeginPlay()
{
    Super::BeginPlay();
    if (APlayerController* PC = Cast<APlayerController>(GetController()))
        if (ULocalPlayer* LP = PC->GetLocalPlayer())
            if (auto* Subsystem = LP->GetSubsystem<UEnhancedInputLocalPlayerSubsystem>())
                Subsystem->AddMappingContext(DefaultMappingContext, /*Priority*/ 0);
}
// DefaultMappingContext is a UPROPERTY(EditAnywhere) TObjectPtr<UInputMappingContext>.

2. Bind actions and read values

cpp
void AMyCharacter::SetupPlayerInputComponent(UInputComponent* InputComponent)
{
    Super::SetupPlayerInputComponent(InputComponent);

    // The component is an Enhanced Input component when the plugin is active.
    if (UEnhancedInputComponent* EIC = Cast<UEnhancedInputComponent>(InputComponent))
    {
        EIC->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AMyCharacter::Move);
        EIC->BindAction(LookAction, ETriggerEvent::Triggered, this, &AMyCharacter::Look);
        EIC->BindAction(JumpAction, ETriggerEvent::Started,   this, &ACharacter::Jump);
        EIC->BindAction(JumpAction, ETriggerEvent::Completed, this, &ACharacter::StopJumping);
    }
}

void AMyCharacter::Move(const FInputActionValue& Value)
{
    const FVector2D Axis = Value.Get<FVector2D>();          // Axis2D action
    AddMovementInput(GetActorForwardVector(), Axis.Y);
    AddMovementInput(GetActorRightVector(),   Axis.X);
}

3. Blueprint equivalent (node flow)

text
Event BeginPlay
  -> Get Controller -> Cast To PlayerController -> Get Local Player
  -> Get EnhancedInputLocalPlayerSubsystem -> Add Mapping Context (IMC_Default, Priority 0)

// IA_Move is exposed as its own event node in the Character's Event Graph:
EnhancedInputAction IA_Move (Triggered)
  -> Action Value (Vector2D) -> Add Movement Input (Forward * Y, Right * X)

Pitfalls

  • No input at all — the mapping context was never added (AddMappingContext), or the

player has no Local Player yet. Add it after possession/BeginPlay.

  • Link/compile error binding in C++"EnhancedInput" isn't in Build.cs

PublicDependencyModuleNames.

  • WASD only moves on two keys / wrong axis — Axis2D needs Modifiers: Negate on the

negative keys (A, S) and a Swizzle Input Axis Values on the vertical (W/S) so both axes map correctly. Raw bindings without modifiers misbehave.

  • `Get<FVector2D>()` returns zero — value-type mismatch: the Input Action is Digital/Axis1D,

not Axis2D. Match the Get<T>() to the action's Value Type.

  • Action fires every frame unexpectedlyTriggered repeats while held for a Down trigger;

use Started/Completed for one-shots (jump press/release), or a Pressed/Tap trigger.

  • Two contexts fight — multiple mapping contexts stack by Priority; a higher-priority

context can consume a key. Manage with priorities and RemoveMappingContext.

References

  • For a complete first-/third-person C++ Character with Enhanced Input (header + source,

including look/jump and a control-rebind note), read references/cpp-setup.md.

  • Primary docs: "Enhanced Input in Unreal Engine"

(https://dev.epicgames.com/documentation/en-us/unreal-engine/enhanced-input-in-unreal-engine).

Related skills

  • input-systems — engine-agnostic input architecture and rebinding strategy.
  • unreal-cpp-gameplay — the Character/Pawn class and module setup.
  • fps-shooter — composes input with a 3D controller and shooting.
같은 저장소의 Skills

더 많은 Skills

모든 Skills
gamedev-skills
커뮤니티

game-feel

Add "juice" and game feel that makes actions satisfying — screen shake, hit-stop/freeze frames, tweened/eased motion, squash & stretch, knockback, and layered audio-visual feedback — as engine-neutral techniques that pair with the detected engine's tween, particle, and camera APIs. Use when the user mentions game feel, juice, "make it feel good/punchy", screen shake, hit stop, screen freeze, easing, squash and stretch, impact frames, or feedback/polish on hits, jumps, pickups, and deaths.

설치 수
5
GitHub Stars
1.1천
업데이트
9월 10일
gamedev-skills
커뮤니티

game-ui-ux

Design and build game UI/UX — HUDs, menus, and overlays — that survive every screen: anchor- based responsive layout, resolution/aspect scaling and safe areas, keyboard/gamepad focus navigation, a screen/menu state stack, and event-driven (not polled) HUD updates. Engine- neutral patterns that pair with the detected engine's UI skill. Use when the user mentions HUD, health bar, main menu, pause menu, settings screen, UI layout, anchors, UI scaling, aspect ratio, safe area, controller/keyboard menu navigation, or wiring UI to game state.

설치 수
5
GitHub Stars
1.1천
업데이트
9월 10일
gamedev-skills
커뮤니티

godot-3d-essentials

Set up a Godot 4.7 3D scene: Node3D transforms, Camera3D, lighting (DirectionalLight3D/OmniLight3D), WorldEnvironment for sky/ambient/tonemap/post, MeshInstance3D materials, and GridMap for tile-based 3D levels. Use when building a 3D scene in a Godot project, placing cameras/lights, configuring environment and post-processing, or working with Node3D/.tscn 3D content and GridMap.

설치 수
2
GitHub Stars
1.1천
업데이트
9월 10일
gamedev-skills
커뮤니티

godot-animation

Animate in Godot 4.7 three ways: AnimationPlayer for keyframed clips (incl. call and signal tracks), AnimationTree with state machines and blend spaces for character animation, and Tween for short procedural/UI tweens via createtween(). Use when working with AnimationPlayer/AnimationTree nodes in a .tscn, blending character states, sprite-sheet animation, or code-driven Tweens.

설치 수
2
GitHub Stars
1.1천
업데이트
9월 10일