Input Management
The Input System was designed to cleanly separate player input logic from Pawn or Character classes. By doing so, it promotes separation of concerns and reusability of such logic, even across different projects.
Input Manager Component
The Input Manager is the backbone of the Input System. It's responsible for initializing and maintaining Input Setups and routing Input Actions to appropriate Input Handlers.
The following functions are accessible to any Input Handler or external callers.
Function | Category | Description |
|---|---|---|
| General | Informs if this Input Manager is currently processing inputs. |
| General | Globally enables input processing. |
| General | Globally disables input processing. |
| Context | Informs if the player's input device is the keyboard and mouse. |
| Context | Provides the forward vector, based on the Pawn or Forward Reference. |
| Context | Provides the right vector, based on the Pawn or Forward Reference. |
| Context | Provides the last input vector handled by the owner, via |
| Context | Provides the Pawn related to this component. |
| Context | Provides the Controller related to this component. |
| Context | Informs if the player is locally controlled. |
| Context | Provides the Ability System Component related to the current Pawn. |
| Setup Data | Checks if a given Setup Data is assigned to the component. |
| Setup Data | Checks if there is an Input Handler set for a given Input Action and Trigger Event. |
| Setup Data | Processes a Setup Data, registering its Input Contexts and Handlers. |
| Setup Data | Removes a Setup Data previously registered. |
| Utility | Rotates the current controller to the mouse location. |
Default Input Setups
You can provide default input setups in two ways:
Default Properties: By setting them directly into the Input Manager, in its Defaults Panel. These are always added to any possessed pawn and cannot be removed.
Pawn Interface: The pawn possessed by the owning Controller can provide input setups via
InputSetupProviderInterface. They will be removed when the pawn is unpossessed.
Providing Input Setups for each pawn is especially useful for games where players possess multiple Pawns with distinct input needs (e.g., vehicles, turrets, or UI-driven characters).
Implementing the Setup Provider Interface
Make sure to set your Input Manager to the Player Controller.
Add the
InputSetupProviderInterfaceto the pawn that will provide specific Input Setups.Create an array of
NinjaInputSetupDataAssetreferences, so you can add Input Setups relevant to the Pawn.Implement the
GetInputSetupsfunction, returning the array of setupsHeader
#pragma once #include "CoreMinimal.h" #include "GameFramework/Character.h" #include "Interfaces/InputSetupProviderInterface" #include "PluginLabsController.generated.h" class NinjaInputSetupDataAsset; UCLASS() class PLUGINLABS_API APluginLabsCharacter : public ACharacter, public IInputSetupProviderInterface { GENERATED_BODY() public: // -- Begin Input Setup Provider implementation virtual TArray<UNinjaInputSetupDataAsset*> GetInputSetups_Implementation() const override; // -- End Input Setup Provider implementation protected: UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Input Setup") TArray<UNinjaInputSetupDataAsset*> CharacterInputs; };Implementation
#include "GameFramework/APluginLabsCharacter.h" #include "Data/NinjaInputSetupDataAsset.h" TArray<UNinjaInputSetupDataAsset*> APluginLabsCharacter::GetInputSetups_Implementation() const { return CharacterInputs; }
Input Mapping Settings
When adding an input mapping, you may need to provide additional context options. In the Enhanced Input framework, this is handled by passing a FModifyContextOptions struct when adding your Input Mapping Context.
You can fine-tune the values in this struct—either globally or per mapping context—by overriding the CreateModifyContextOptions function in Blueprints or C++.
Runtime Management
Input Setups can be added and removed at runtime. This is useful when you want certain inputs to only become available when specific gameplay elements happen.
The Input Manager Component provides dedicated functions to add or remove Input Setups whenever necessary. It is important to ensure that any context you add is properly removed later to avoid unexpected behavior.
Input Setups can be added and removed using AddInputSetupData and RemoveInputSetupData.

Global State
You can completely disable and enable input handling in an Input Manager. This can be useful during in-game cutscenes, when all input should be blocked without removing active Input Setups.

