How-To: Bind Ability Input

Goal: make a key press activate a GAS ability by input tag - forwarding the config's AbilityInputActions to your ability system.

Prerequisites
A UCrimsonInputConfig with AbilityInputActions filled, and an actor that answers the engine's IAbilitySystemInterface - a pawn or player state carrying a UAbilitySystemComponent. Everything on this page uses Epic's GameplayAbilities API only; CrimsonInput ships no ability system of its own.

1. Bind and forward to the ability system

CrimsonInput's binders hand your callback an FGameplayTag - the plugin does not know your ability system. Forward that tag to whatever ASC your project uses, discovered through the engine's IAbilitySystemInterface. Blueprint places one Enhanced Input Action event per ability action and calls GAS's own Try Activate Abilities By Tag; C++ bulk-binds the whole AbilityInputActions list with one call and matches the tag against each granted spec, so it gets a true release edge as well.

One chain per ability action, in the pawn's Event Graph: IA_Ability1 (Enhanced Input Action) -> Triggered -> Get Ability System Component -> Try Activate Abilities By Tag (Gameplay Tag Container = a Make Gameplay Tag Container holding InputTag.Ability.1). Place the event by right-clicking and searching the action asset's name. Point Get Ability System Component at the actor that owns your ASC - Self for a pawn-owned ASC, or Get Player State first when it lives on the player state.

Get the ASC first, then activate by tag
Get Ability System Component (UAbilitySystemBlueprintLibrary) resolves the ASC through IAbilitySystemInterface, falling back to a component search - point it at the pawn or the player state, whichever owns your ASC. Try Activate Abilities By Tag then matches the tag against each granted ability's Asset Tags, so give the ability InputTag.Ability.1 under Class Defaults -> Tags -> Asset Tags.
The release edge is C++
GAS exposes no Blueprint-callable release by tag. Wire the Completed and Canceled pins to a BlueprintCallable forwarder on your own C++ pawn - the C++ tab's ForwardAbilityInput is exactly that function; mark it UFUNCTION(BlueprintCallable, Category = "Input") and call it from Blueprint. Press-only abilities need nothing extra.
Why release binds Completed and Canceled
Enhanced Input fires Completed on a normal release, but Canceled when a trigger was still Ongoing (e.g. a UInputTriggerCrimsonPressAndHold released before its hold threshold). Both mean the player let go, so route both to your released handler. BindAbilityActions does this for you in C++; in Blueprint, wire both pins into the same forwarder.
Verify
Pressing an ability key activates the ability granted with that input tag; releasing it (immediately or after a hold) reaches your released handler exactly once.

2. Grant abilities with an input tag

For the ASC to match input to an ability, the ability must carry the same input tag you used in the config. The C++ forwarder above reads the tag off the granted spec, so add it to the spec's dynamic source tags at grant time. The Blueprint path uses Try Activate Abilities By Tag, which reads the ability's Asset Tags instead - set those in the ability Blueprint under Class Defaults -> Tags -> Asset Tags. Setting both costs nothing and keeps either path working.

cpp
const FGameplayTag Tag = FGameplayTag::RequestGameplayTag(FName("InputTag.Ability.1"));
FGameplayAbilitySpec Spec(AbilityClass, /*Level*/ 1, INDEX_NONE, /*SourceObject*/ this);
Spec.GetDynamicSpecSourceTags().AddTag(Tag);
ASC->GiveAbility(Spec); // server only
Grant on the server
GiveAbility is server-authoritative - call it where the ASC has authority (HasAuthority()), never on a client. Input events fire on the owning client and the ASC replicates activation with GAS prediction.

3. Combo-capable characters (advanced)

If a character routes input through a combo controller, use BindAbilityActionsWithAction instead - it binds press to Started and passes the UInputAction* and the tag, so the controller can identify inputs by action identity and fall through to the ASC when it does not consume the press. This is the binder CrimsonCore uses.

cpp
// Callback signature is void(UInputAction* Action, const FGameplayTag& Tag)
CIC->BindAbilityActionsWithAction(InputConfig, this,
&AMyCharacter::Input_ComboPressed,
&AMyCharacter::Input_ComboReleased,
AbilityBindHandles);
On the full stack (CrimsonCore - requires all Crimson plugins)
CrimsonCore's UCrimsonHeroComponent calls BindAbilityActionsWithAction, offers the press to its combo controller, and otherwise forwards the tag to the ability system - all with zero wiring from you. Standalone, the C++ tab above is the whole equivalent. See Concept: Full-Stack Integration & Multiplayer.

See also

  • How-To: Get the Building Blocks - getting the subsystem, config, and user settings.
  • How-To: Bind Native Input - the non-ability binder and the press-and-hold trigger.
  • Concept: Full-Stack Integration & Multiplayer - the combo router and prediction model.