Ninja Bear Studio Plugins Help

Combat and Input

Ninja Combat can benefit from GAS-related Input Handlers provided by Ninja Input.

Forward Reference

Ninja Combat usually needs a Forward Reference to determine angles for directional abilities, such as the Evade Ability. In parallel, Ninja Input might need a Forward Reference as well, usually to orient pawns in top-down perspectives.

Both systems can share the same Forward Reference. This is usually a Scene Component, such as an Arrow Component, configured with absolute rotation.

Add a shared Forward Reference component

  1. In the Character Class, create a new Arrow Component, parented to the Root Component, usually the character's Capsule Component.

  2. Add the Combat.Component.ForwardReference tag to the list of Component Tags.

  3. Add the Input.Component.ForwardReference tag to the list of Component Tags.

  4. Set the Transform to use Absolute Rotation, so the component is not affected by its parent rotation.

  5. Implement or override the Combat System interface function, GetCombatForwardReference, so it returns the Arrow Component.

Gameplay Abilities

Ninja Combat is built on the Gameplay Ability System and therefore it is very ability-centric. Ninja Input provides Input Handlers for ability activation and interruption that can be used out-of-the-box to activate Combat Abilities.

Combo Inputs

The Combo System in Ninja Combat is designed to try to activate a Combo Ability while outside a Combo Window, or send a Gameplay Event to advance the combo, if a Combo Window is open. This is a generic GAS-based design, leveraging Gameplay Tags. Because of that, Ninja Input provides a Combo Input Handler that can be used out-of-the-box.

Configure Combat Combo Handlers

Adding Combo Handlers
  1. Open your Input Setup and add one Combat Combo handler for each supported Input Action (e.g., Primary and Secondary Actions).

  2. Configure the Activation Tags so they match your Gameplay Ability Tags.

    Configure the Advancement Tags so they match your Combo Event Tags.

  3. If the Input Buffer is being used to enhance Combo Windows, check Can Be Buffered.

    Optionally, designate a Buffer Channel Tag for combo inputs.

  4. Configure your Input Actions related to your Combo Inputs (e.g., Primary and Secondary Actions).

    Add Triggered to the list of Triggered Events, if necessary.

Ability Targeting

The Gameplay Ability System supports target confirmation and cancellation by using Targeting Actors. While those actors are active, the Ability System Component waits for additional input so it can gather the relevant targets.

Ninja Input provides Input Handlers compatible with this flow. However, by default, they only perform these targeting operations at the Ability System Component level. Since Ninja Combat keeps track of the Targeting Actor currently active, it makes it possible for these flows to also happen at the Targeting Actor level, which might be ideal in some cases.

Integrate the Target Confirmation Handler

Providing the Targeting Actor
// Ninja Bear Studio Inc., all rights reserved. #pragma once #include "CoreMinimal.h" #include "Input/Handlers/InputHandler_AbilityTargeting.h" #include "InputHandler_CombatTargetConfirm.generated.h" UCLASS(Abstract, DisplayName = "Combat Target Confirm") class UInputHandler_CombatTargetConfirm : public UInputHandler_AbilityConfirm { GENERATED_BODY() public: UInputHandler_CombatTargetConfirm(); virtual AGameplayAbilityTargetActor* GetAbilityTargetActor_Implementation( const UNinjaInputManagerComponent* Manager) const override; };


// Ninja Bear Studio Inc., all rights reserved. #include "Input/Handlers/InputHandler_CombatTargetConfirm.h" #include "NinjaCombatFunctionLibrary.h" #include "Abilities/GameplayAbilityTargetActor.h" #include "Components/NinjaInputManagerComponent.h" #include "Interfaces/Components/CombatTargetManagerInterface.h" UInputHandler_CombatTargetConfirm::UInputHandler_CastTargetConfirm() { AbilityTargetingOperation = EInputAbilityTargeting::TargetingActor; } AGameplayAbilityTargetActor* UInputHandler_CombatTargetConfirm::GetAbilityTargetActor_Implementation(const UNinjaInputManagerComponent* Manager) const { if (!IsValid(Manager)) { return nullptr; } const UActorComponent* TargetManager = UNinjaCombatFunctionLibrary::GetTargetManagerComponent(Manager->GetOwner()); if (!UNinjaCombatFunctionLibrary::IsValidTargetManagerComponent(TargetManager)) { return nullptr; } return ICombatTargetManagerInterface::Execute_GetAbilityTargetActor(TargetManager); }
  1. Create a new Input Handler based on InputHandler_AbilityConfirm.

    You can create Input Handlers in the Content Browser by clicking Add, then selecting Ninja Bear StudioNinja InputInput Handler, and then selecting the base class.

  2. Override the GetAbilityTargetActor function.

  3. Retrieve the Target Manager Component from the Input Manager's Pawn.

  4. Return the current Ability Targeting Actor by calling the Target Manager Component's GetAbilityTargetActor function.

  5. Optionally, adjust the Ability Targeting Operation to only execute at the actor level.

Integrate the Target Cancellation Handler

  1. Create a new Input Handler based on InputHandler_AbilityCancel.

  2. Repeat the same integration steps from the Target Confirmation Handler.

  3. Optionally, adjust the Ability Targeting Operation to only execute at the actor level.

Target Lock

Target Lock is executed by the Target Lock Ability, which supports common activation and additional events to scan for targets, cycle between available targets and dismiss the current target.

Common GAS-related handlers from Ninja Input can be used to activate the ability, scan for targets, cycle between targets, and dismiss the current target.

Toggle the Target Lock Ability

  1. Navigate your Target Lock Ability and add Input.Ability.Toggled to the list of Ability Tags.

  2. Create a new Input Handler based on InputHandler_AbilityTags.

  3. In the new Input Handler, configure the Gameplay Ability Tags used for activation of the Target Lock Ability.

  4. Configure the Input Action as usual.

Scan for a Target

  1. Create a new Input Handler based on InputHandler_GameplayEvent.

  2. Set Combat.Event.Target.Scan as the Event Tag.

  3. Configure the Input Action as usual.

Cycle Available Targets

  1. Create two new Input Handlers based on InputHandler_GameplayEvent.

  2. In the first Input Handler, set Combat.Event.Target.Left as the Event Tag.

  3. In the second Input Handler, set Combat.Event.Target.Right as the Event Tag.

  4. Configure the Input Actions as usual.

Fire Intent

The Firearms Module handles Fire Intent using functions from the Firearm Component. These functions are responsible for requesting activation or deactivation of the Shoot Ability.

Once this handler is created, you can reuse it across different projects by adding it to the Input Setup and mapping it to the appropriate Input Action. This handler expects an Input Action with both Pressed and Released triggers.

Create the Fire Intent Handler

Managing Fire Intent
// Ninja Bear Studio Inc., all rights reserved. #pragma once #include "CoreMinimal.h" #include "NinjaInputHandler.h" #include "InputHandler_ManageFireIntent.generated.h" UCLASS(Abstract, DisplayName = "Manage Fire Intent") class UInputHandler_ManageFireIntent : public UNinjaInputHandler { GENERATED_BODY() public: UInputHandler_ManageFireIntent(); virtual AGameplayAbilityTargetActor* GetAbilityTargetActor_Implementation( const UNinjaInputManagerComponent* Manager) const override; protected: /** Query used to retrieve the equipped firearm. */ UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Manage Fire Intent") FGameplayTagQuery EquippedFirearmQuery; };


// Ninja Bear Studio Inc., all rights reserved. #include "Input/Handlers/InputHandler_ManageFireIntent.h" #include "NinjaCombatFirearmFunctionLibrary.h" #include "Components/NinjaCombatFirearmComponent.h" #include "Components/NinjaInputManagerComponent.h" #include "GameFramework/Pawn.h" UInputHandler_ManageFireIntent::UInputHandler_ManageFireIntent() { TriggerEvents.Add(ETriggerEvent::Triggered); } void UInputHandler_ManageFireIntent::HandleTriggeredEvent_Implementation(UNinjaInputManagerComponent* Manager, const FInputActionValue& Value, const UInputAction* InputAction, const float ElapsedTime) const { UNinjaCombatFirearmComponent* FirearmComponent = UNinjaCombatFirearmFunctionLibrary::FindFirearmComponent(Manager->GetPawn(), EquippedFirearmQuery); if (!IsValid(FirearmComponent)) { return; } const bool bIntent = Value.Get<bool>(); if (bIntent) { FirearmComponent->TryOpenFire(); } else { FirearmComponent->TryCeaseFire(); } }
  1. Create a new Input Handler based on NinjaInputHandler.

    You can create Input Handlers in the Content Browser by clicking Add, then selecting Ninja Bear StudioNinja InputInput Handler, and then selecting the base class.

  2. Create a Gameplay Tag Query property, which will be used to retrieve the active firearm.

  3. Override HandleTriggeredEvent so it retrieves the Firearm Component by query.

    Then, based on the input value, invoke TryOpenFire or TryCeaseFire, respectively.

  4. Add Triggered to the list of Trigger Events.

  5. Optionally, set Manage Fire Intent as the Display Name.

Disabling Input

Ninja Input can block movement, camera and rotation input based on the presence of the respective blocking tags. This can be used by certain Gameplay Abilities to block specific input categories. For example:

  1. The Target Lock Ability has tags to block camera input, since while locked on a target, the camera yaw should be locked, facing the target.

  2. The Opportunity Attack Ability has tags to block input for movement and camera, so the participants in the paired animation remain in their predefined positions and the cinematic camera is not affected.

Input Buffer

Ninja Input provides an Animation-Based Input Buffer, which is a common requirement for certain combat systems. This allows players to be less precise with their inputs while still getting the desired outcome, which tends to create a more responsive input feel. Common examples are:

  1. Buffering an attack input pressed while the Evade Ability is still executing, so the attack starts as soon as the evade can transition.

  2. Buffering a combo input pressed slightly before the Combo Window opens, so the next combo step still activates when the window becomes valid.

21 May 2026