Create a Combo
The Combo System is used to trigger attack sequences that can even branch out depending on different inputs. In this guide you will learn more about it and how to mix Attack and Cast abilities in a combo.
Create a basic Combo
In this first part of the Combo guide, the default Attack Ability created before will be converted into a combo. This will give you an overview of the combo system, its configuration and main objects.
As done before, configure all your attack abilities using the new animations.
Configure the Ability Tags for the attack abilities, following a cohesive pattern, such as:
Ability.Attack.Combo.Primary.A
,Ability.Attack.Combo.Primary.B
, or something similar.Remove unnecessary ability tags from the original Attack Ability, since it won't be activated directly from input anymore.
Create a new State Tree, using the CombatComboComponentSchema.
If you are using Unreal Engine 5.3, add the Combo Component evaluator to the tree and bind the Actor input parameter to the one available in the state tree context.
Add the Combo State evaluator and bind the Combo Manager input parameter to the one exposed yb the Combo Component evaluator or from the context.
Create a new child state from the root, and set it as a state and configure the Selection Behavior to Try Select Children in Order. Name it Primary Attacks.
Create a new child state in the group and name it Primary Attack 01, or any other meaningful name that you prefer. Create all primary attack states for your combo in the same way.
Add an Integer Compare check to the Entry Conditions list. Set the left side to the Combo Count from the Combo State evaluator and the right value to 0, which is the very first possible combo count.
Add an Activate Combo Ability task to the Task list. Set the activation tag to
Ability.Attack.A
, as it was set in the Ability Activation Tags. Configure the Task to increment the Combo Count.Add an Event Transition to the list of Transitions, based on the
Combat.Event.Combo.Attack.Primary
tag. Set the transition to go to Attack 02.Add a Finished Transition to the list of Transitions, Set this transition to complete the State Tree.
Repeat steps 6 to 9 for each other attack, ensuring that the Entry Conditions are updated correctly and the Event Transitions move to the correct next step. The last attack only has the "Finished" transition.

Create a new Gameplay Ability, using
CombatAbility_Combo
as the base.Set the state tree configured in the previous step.
Add all abilities used by the combo to the list of abilities.
Configure the Ability Tags, adding
Ability.Combo
, so it can be used for activation.Configure the Blocked Ability Tags, adding
Ability.Attack.Secondary
.

Cast Ability and Combo Branching
In this second part of the Combo guide, a new Cast Ability will be created to show different kinds of abilities being added to the combo. Then we can use it to branch between primary and heavy attacks.
Create a new Blueprint based on
NinjaCombatCastActor
. This actor will be spawned by the Cast Ability.Set the original Cast Sphere radius to
200
. This is the area of the effect, where targets will be collected.Set the Time To Live Outside Pool property to
5.0
. This will be used later on when we configure the Actor Pool component.Add a Niagara Particle System Component, used to represent the effect. Set the desired effect asset.
Add an Audio Component, to play the effect sound. Set the desired sound asset.
Create a function called
SetLocationFromShieldLocation
. It will be used to place this Cast Actor where the shield currently is.In the Event Graph, implement the
StartCast
event, defined by the base class. The goal is to adjust the location using the function from the previous step, track when the VFX is finished so we can eventually return the actor to the pool, and activate all systems.
tip
For better gameplay results, make sure that your particle effect size and collision radius are compatible!
note
When implementing the
StartCast
event in the Event Graph, make sure to always call the parent implementation!
note
If all your Cast Actors will include VFX and SFX, you can create a base Blueprint or C++ with those components, and always extend from this version instead.