How-To: Create an Input Config
Goal: author a UCrimsonInputConfig that maps your UInputAction assets to gameplay tags, so all binding and lookups happen by tag.
UInputAction assets (Quick Start step 2) and an InputTag gameplay-tag hierarchy (or you will add one in step 3).1. Create the asset and fill the lists
UCrimsonInputConfig is a Const data asset with three arrays of FCrimsonInputAction (an InputAction + InputTag pair). Put each action in the list that matches how it is consumed.
| List | Bound how | Examples |
|---|---|---|
NativeInputActions | BindNativeAction -> a C++ callback (or a Blueprint Enhanced Input event) | Move, Look, Jump, Crouch |
AbilityInputActions | BindAbilityActions / BindAbilityActionsWithAction -> GAS by input tag | Ability.1 - Ability.6, Confirm, Cancel |
UIInputActions | FBindUIActionArgs(UInputAction*, ...) in a CommonUI widget | UI.Escape, UI.Confirm, UI.Back, UI.Tab |
InputTag parent tag.2. Look actions up by tag
The three Find...InputActionForTag functions are the read side of the config - they are BlueprintCallable, so both C++ and Blueprint resolve an action from a tag. Pass bLogNotFound = false for optional lookups. You call them on a config reference - see How-To: Get the Building Blocks step 2.
Drag your config variable into the graph (see How-To: Get the Building Blocks step 2) and pull off it: Your Input Config -> Find Ability Input Action For Tag (Input Tag = InputTag.Ability.1, b Log Not Found = unticked). The Return Value is the UInputAction - feed it into whatever needs the asset, such as a key-glyph node. The native and UI lists have their own nodes, Find Native Input Action For Tag and Find UI Input Action For Tag, with identical pins.
UInputAction; an unmapped tag returns null (and logs only when bLogNotFound is true).3. Name your input tags
Keep input tags under a dedicated InputTag parent so the pickers stay scoped. Declare them in DefaultGameplayTags.ini (or as native tags):
; DefaultGameplayTags.ini+GameplayTagList=(Tag="InputTag.Move")+GameplayTagList=(Tag="InputTag.Look.Mouse")+GameplayTagList=(Tag="InputTag.Jump")+GameplayTagList=(Tag="InputTag.Ability.1")+GameplayTagList=(Tag="InputTag.Ability.Confirm")+GameplayTagList=(Tag="InputTag.UI.Escape")+GameplayTagList=(Tag="InputTag.UI.Back")
See also
- How-To: Get the Building Blocks - how to reference this config from Blueprint or C++.
- How-To: Bind Ability Input - forward
AbilityInputActionsto your ability system. - How-To: Bind Native Input - wire
NativeInputActionsto C++ callbacks. - Concept: Tag-Driven Input - why the config is the indirection layer.