UEnhancedInputComponent
#include "EnhancedInputComponent.h" Description
The input component used with the Enhanced Input system. Replaces UInputComponent for binding input actions to callbacks using UInputAction assets and ETriggerEvent.
Caveats & Gotchas
- • Requires the EnhancedInput plugin to be enabled in your project. Ensure DefaultPawnClass or your PlayerController sets the input component class to UEnhancedInputComponent (or set it in Project Settings > Input > Default Input Component Class).
- • Cannot mix Enhanced Input bindings with legacy UInputComponent BindAxis/BindAction calls on the same component — they use separate binding tables.
- • Input bindings added via BindAction are tied to the component's lifetime. Re-binding in SetupPlayerInputComponent is safe — it's called fresh after possession.
Example
SetupPlayerInputComponent C++
void AMyCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
if (UEnhancedInputComponent* EIC = Cast<UEnhancedInputComponent>(PlayerInputComponent))
{
EIC->BindAction(JumpAction, ETriggerEvent::Started, this, &AMyCharacter::Jump);
EIC->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AMyCharacter::Move);
EIC->BindAction(LookAction, ETriggerEvent::Triggered, this, &AMyCharacter::Look);
}
} Functions (1)
Utility 1 ▼
| Access | Type | Name |
|---|---|---|
| public | function | UEnhancedInputComponent::BindAction |
See Also
Tags
Version History
Introduced in: 5.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?