Ninja Bear Studio Plugins Help

Combo Inputs

The Combo Ability expects two types of input: the usual activation action and a gameplay event to advance the combo.

Combo Input
void UInputHandler_CombatCombo::HandleTriggeredEvent_Implementation(UNinjaInputManagerComponent* Manager, const FInputActionValue& Value, const UInputAction* InputAction, const float ElapsedTime) const { const AActor* Pawn = IsValid(Manager) ? Manager->GetPawn() : nullptr; const UAbilitySystemComponent* AbilityComponent = UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(Pawn); if (!IsValid(AbilityComponent)) { return; } if (AbilityComponent->HasMatchingGameplayTag(ComboStateTag)) { AdvanceCombo(Pawn, InputAction); } else { StartCombo(Pawn); } } void UComboInputHandler::StartCombo() { if (!bHandlesActivation || ActivationTags.IsEmpty()) { return; } UAbilitySystemComponent* AbilityComponent = UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(Owner); if (!IsValid(AbilityComponent)) { return; } // "ActivationTags" is a tag container used to activate the Combo Ability. // It should match the "Ability Activation" tags container in the Gameplay Ability. // AbilityComponent->TryActivateAbilitiesByTag(ActivationTags); } void UComboInputHandler::AdvanceCombo(const AActor* Owner, const UInputAction* InputAction) { UAbilitySystemComponent* AbilityComponent = UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(Owner); if (!IsValid(AbilityComponent)) { return; } FGameplayEventData* Payload = new FGameplayEventData(); Payload->Instigator = Owner; Payload->Target = Owner; Payload->EventTag = AdvancementTag; Payload->OptionalObject = InputAction; // "AdvancementTag" is a gameplay tag used to advance the combo to the // next attack. It should match the event configuration in the combo ability and // indicate a valid event in the Combo State Tree. // AbilityComponent->HandleGameplayEvent(AdvancementTag, Payload); }

In the example above:

  1. The input first checks if the combo window is open, using a specific Gameplay Tag.

  2. If the window is open, a gameplay event is sent to advance the combo.

  3. The event’s payload includes the Input Action (as an optional object).

  4. If the window is not open, the input simply activates the Combo Ability as usual.

The Event Tag you send depends on the Event Mode configured in your Combo Ability:

  • Gameplay Tag Mode: Send the exact Gameplay Tag used by your State Tree transitions (e.g. Combat.Event.Combo.Attack.Primary). You do not need to send the Input Action in this mode.

  • Input Action Mode: Always send the gameplay event with the tag Combat.Event.Combo.Attack. Include the Input Action in the payload. The Combo Ability will map it to a transition tag defined in the State Tree.

Last modified: 01 September 2025