How-To: Bind Native Input

Goal: handle a NativeInputActions entry (move, look, jump) - in Blueprint with an Enhanced Input event, in C++ by tag with BindNativeAction.

Prerequisites
A UCrimsonInputConfig with NativeInputActions filled and a pawn using UCrimsonInputComponent.

1. Handle the action

In Blueprint you do not need the plugin's binder for native input - place the standard Enhanced Input Action event for your UInputAction and handle it. In C++, BindNativeAction resolves the tag to the action in NativeInputActions, binds it for one ETriggerEvent, and returns the bind handle (or 0 if the tag is missing).

Right-click in the pawn's Event Graph and search the action asset's name to place its Enhanced Input Action event, then handle the Triggered pin. For a move action: IA_Move (Triggered) -> Break Vector 2D on the event's Action Value, then Add Movement Input twice - World Direction = Get Actor Forward Vector with Scale Value = Y, and World Direction = Get Actor Right Vector with Scale Value = X. A Digital (bool) action such as jump needs no break: run Triggered straight into Jump.

Verify
The mapped key drives your handler with the expected value. In C++, a tag missing from NativeInputActions logs a warning and returns handle 0.

2. Remove bindings with RemoveBinds (C++)

When you unpossess or tear down, call RemoveBinds with the handle array. It removes each binding and empties the array.

cpp
CIC->RemoveBinds(NativeBindHandles); // clears every handle it holds

3. Tap / Hold with the press-and-hold trigger

When one action needs Tap / Hold / Toggle behavior, open the UInputAction, click + on its Triggers array and pick Crimson Press and Hold (UInputTriggerCrimsonPressAndHold). There is nothing to configure on it. It fires Triggered once on actuation, stays Ongoing while held, and fires Completed only on a real release - so tap and hold are distinguishable, and an ability binding's Completed+Canceled release still fires.

Verify
A tap and a hold on the same action produce distinct behavior, and an ability's released handler still fires when the key is let go.
On the full stack (CrimsonCore - requires all Crimson plugins)
CrimsonCore binds native input inside GAS abilities - UCrimsonGameplayAbility_BindNativeInput activates once on spawn, calls BindNativeAction, and re-checks the ability's tag requirements per input event. That pattern is only for always-on input (move, look, sprint); discrete actions use normal input-triggered abilities. See Concept: Full-Stack Integration & Multiplayer.

See also

  • How-To: Bind Ability Input - the GAS binders and release semantics.
  • Concept: Full-Stack Integration & Multiplayer - ability-self-binding for native input.