Hey! : )
I’ll provide a documentation and will upload this plugin to UE Marketplace.
A short example of how to add and bind a Gameplay Ability to a Enhanced Input Action:
Step 1: Setup your binding target, that must be your pawn or controller:
In this example, i’m using a APlayerController class with C++ code:
-
Implement the IAbilityInputBinding interface
-
Implement the functions SetupAbilityInput and RemoveAbilityInputBinding (i didn’t provide a complete function to use, the devs are free to create in they ways):
I’m using a client RPC because i used it inside a multiplayer project.
These 2 functions will be called by the plugin to bind your ability inputs.
Now, that’s how i implemented these functions:
-
Created a struct to handle the input binding ID:
-
Created only 2 functions to manage ability input press and release (which i use after binding):
And that’s my functions:
-
SetupAbilityInput:
-
RemoveAbilityInputBinding
-
OnAbilityInputPressed:
-
OnAbilityInputReleased:
Step 2: Configure your modular feature
-
Create a new modular plugin
-
Add a new action: Add Abilities
-
Set your pawn class on Target Actor Class, i’m using PECharacter
-
Set your input binding owner, it’s the class where you implemented the IAbilityInputBinding interface. In the example i’m using a controller.
-
Set your InputID Enumeration Class. This plugin is currently supporting only blueprint enumerations. That’s my enum:
-
Create your ability mapping:
InputID Value Name correspond to your enumeration Display Name.
A way to bind a Input Action without provide a Gameplay Ability:
-
Add the action Add Enhanced Input Mapping instead Add Abilities:
-
Set your pawn class on Target Pawn Class, i’m using PECharacter
-
Set your input binding owner, it’s the class where you implemented the IAbilityInputBinding interface. In the example i’m using a controller.
-
Add your Action Bindings and enable Setup Ability Input inside Ability Binding Data:
-
Same from Add Abilities: Set your InputID Enumeration Class. This plugin is currently supporting only blueprint enumerations. InputID Value Name correspond to your enumeration Display Name.
In this project i’m using all of this: Codename: Project Elementus (Unnamed Template) - Showcase / Game Development - Unreal Engine Forums