Combo System for UE5: Attack Chains, Input Buffering, Branches
Documentation Unreal Engine Player Combat Actions Tutorial
Build melee combos in Unreal Engine 5 without code: light and heavy chains in a visual graph, input buffering, branches on the button or the target, and dodge cancels.
A combo system needs a chain, where each press leads to the next move, a buffer that keeps a press made a little early or a little late, and branches, so a heavy press after a light plays a finisher and a dodge cuts any swing. In Universal Player Combat the chain is an Action Graph you wire in the editor, and the buffer and the cancel rules are settings on it.
The graph runs on Unreal Engine 5.6, 5.7 and 5.8, and a combo you wire plays the same way in single player and online.
The problem
A hand-built combo usually starts as a counter, a "can combo" flag and an anim notify that resets both. Each extra move adds a branch to that Blueprint. A press made a few frames early is lost, a heavy finisher needs its own flag, and a dodge out of a swing turns into a special case in every attack.
An Action Graph draws the moveset instead. Each move is a card that plays a montage, each wire names the button that leads on, and a window on the montage says when that press counts. A press made early waits for the window, and a wire marked Interrupt cuts the swing once its Cancel Window Start (0.1 seconds in) has passed.
Build a light chain with a heavy branch
You need the sword from Build Your First Combo:
AG_MySword, with Light 1, Light 2 and Light 3 chained on light attack, on Item_MySword.Set it up
5 minutes- 1
Add a heavy move
OpenAG_MySword, right-click the canvas and pick Add Action Node. Name itHeavy(Node Name) and set its Montage toAM_UPC_Sword_Heavy_1, the demo sword's first heavy. Its trace window sweeps the hit volume namedBlade, the oneItem_MySwordcarries. - 2
Branch from Light 1
Drag from Light 1's right edge to Heavy. The drag joins Light 1's router; set the row's Input Tag toUPC.Input.HeavyAttack. With both wires in place, Light 1 leads two ways: a light press to Light 2, a heavy press to Heavy.Light 1AM_Attack_LightUPC.Input.LightAttackUPC.Input.HeavyAttackFailedLight 2AM_Attack_LightHeavyAM_HeavyOut Of BreathAM_TiredLight 1's router with one row per way out: a light press leads on to Light 2, a heavy press branches to Heavy, and Action Failed (a move that could not start) leads elsewhere. The quick start wires the first two. - 3
Map the heavy key
OnItem_MySword's Equippable fragment, add an Input Mappings row: Input ActionIA_UPC_HeavyAttack, Input TagUPC.Input.HeavyAttack.IMC_UPC_Sword, the context the item already names, carries that action; the demo plays it on the right mouse button. - 4
Compile, play and branch
Press Compile, save and playLVL_UPC_Demo. At a training dummy, click, then right-click during Light 1: Light 1 plays out and Heavy follows. Three clicks still play the light chain.
When a press counts: the input buffer
Mark the frames where the next move may start with the UPC Action Window notify state on the attack montage. A press made before the window waits for it, so a player mashing the button still chains on the beat.
AM_Attack_Light
0.0
0.2
0.4
0.6
0.8
1.0
1.2
1.4
1.6
Notifies
UPC Action Window
Light attack
pressed
Light 2
Select empty canvas in the graph editor to set the buffer for the whole graph:
| Setting | Does |
|---|---|
| Default Input Buffer Mode | Which early press waits for the window: Accept Last (default) the newest, Accept First the first, Ignore none. |
| Late Input Grace | A press up to 0.25 seconds after a move ends still follows its links, so a slightly late click plays the next hit. 0 turns it off. |
| Held Input Restart Window | A press only idle answers, such as a dodge mid-swing, waits for the swing to end and then plays, as long as the swing ends within 0.35 seconds of the press. |
| When No Window Is Authored (on a move) | With no window on the montage: At Completion (default) waits for the move's end, which suits a combo cut into montage sections; From Entry lets the press cut in at once. |
A move can override the buffer mode and the late grace under its own Execution settings (Action Graph).
Branch on more than the button
A wire can ask for more than a press. Several wires on one button pick the highest Priority that passes, then the one with more conditions.
| You want | Put on the wire |
|---|---|
| A lunge when the target stands far off | A Target Distance condition, and a higher Priority than the plain strike |
| A side step when the stick points left | A Direction condition |
| A finisher on a staggered enemy | A Target State condition asking for the stagger tag |
| A heavy only with stamina left | A Vital Threshold condition |
| Moves that exist only while a shield is drawn | The shield's tag in Required Tags |
| A charged heavy | An Input Action with a Hold trigger: Input Pressed fires as the hold completes, Input Released Early on a release before it |
| A recovery after a heavy, when no press follows | An Action Completed wire into a recovery move |
| A stumble when the move cannot be paid for | An Action Failed wire, out of a move whose stamina cost was refused |
Two buttons pressed together can send one tag of their own, such as light and heavy sending
UPC.Input.Special for a signature move, while each alone keeps its move (Chords).Cancel a swing into a dodge or a parry
| Pick | When |
|---|---|
| An Interrupt wire from the swing | One move cuts another: a parry or a dodge out of a committed swing. The press ends the swing and starts the wire's target. |
| Can be Cancelled on the swing | Any input the swing has no wire for cuts it and runs from idle, such as a dodge wired only from idle. Its own input cannot cut it, so mashing attack does not restart a swing. |
Both wait for Cancel Window Start (0.1 seconds into the move). To reach a parry from every step of a combo without drawing a wire from each, add one alias and tick the moves it starts from:
Light 1
AM_Attack_Light
Light 2
AM_Attack_Light
Light 3
AM_Attack_Light
ALIASUPC.Input.Guard (Interrupt)
3 actions
UPC.Input.Guard
Parry
AM_Parry
One weapon, its own combos
A drawn weapon hands the character its own graph and keys through its Equippable fragment, so a sword and a spear each bring their combos, and putting the weapon away takes them back (Items). Moves shared across weapons, such as a shield's guard, live in one graph that each weapon's graph folds in as a sub graph (Action Graph Editor).
Watch it run
Keep the graph open while you play: the card the character plays turns green, and each gate shows its cooldown live. In the console,
UPC.Debug.Actions 1 writes each character's move, its window and any waiting press above its head (Action Graph Editor).AdvancedWhat happens to one press
An input enters at the topThe first stop that acts on it ends the walk
1
Global Block Tags
Action Graph component
While any of these tags is on the character, a press drops and is not held for later. Releases still pass, so a held move can end.
2
Pick the transition
the current node's transitions
Transitions for this input and this moment compete when their Required Tags, Blocked Tags and Conditions pass: highest Priority, then most conditions, then first in the list.
3
Interrupt
the transition's Timing
A winning transition set to Interrupt fires at once when the running move is past its Cancel Window Start; the action window and the cancel rules play no part. A press made earlier goes on to the stops below.
4
Cancel
the node's Cancellation settings
A move marked Can be Cancelled, past its Cancel Window Start, that this input is allowed to cancel, is cut when it has no transition for the input or its window is closed. On Action Cancelled fires and the input runs again from Root.
5
Chain
Root, or an open action window
At Root, or while the running move's action window is open, the winning transition is taken.
6
Wait
Default Input Buffer Mode, or the node's Input Buffer Override
Otherwise the press waits in a one-press buffer, when this node or Root has a transition for it. It runs against this node when the window opens, or from Root when the move ends; a press only Root answers drops if the window opens first. The buffer mode decides which press is kept; anything else drops.
The input that started a move cannot cancel that move, so mashing the attack button cannot cut a swing back to its own start.
- A waiting press that continues the combo counts however old; Ignore suits a move that should not queue the next attack, Accept First a charge.
- Only a move that ran to its end and returned to idle grants Late Input Grace; one cut short does not.
- Action Speed on the Action Graph component plays every move faster or slower, montages, delays and windows together, so a slowed character keeps the same combo rules.
MultiplayerCombos online
Each move starts on the player's machine at the press, and the server confirms it; a move the server refuses sends the character back to the server's move. The server also refuses a chain that came too early for the move's action window, within a grace for lag. Multiplayer Melee Combat gives the numbers and covers hit checks.
AlternativePress a combo from Blueprint or AI
Process Action Input sends one input tag, as a button does, and returns whether the move started, waited or dropped. Queue Input Sequence feeds a list of inputs, chained as each move starts. The demo's enemies attack through Queue Input Sequence, from a Behavior Tree pressing the player's own graphs (Action Graph).
Common questions
Do I need C++? No. The graph, the items and the montage windows are assets you edit in the editor, and a payload, condition or hook of your own is a Blueprint class.
Can a combo cost stamina or have a cooldown? Yes. A move takes Costs, such as 25 stamina, and Gates, such as a cooldown with two charges (Gates, Costs and Cooldowns).
Can one montage hold the whole combo? Yes. Each card plays one section of it, as the demo sword's
AM_UPC_Sword_Combo does.Do attacks turn toward the enemy? Under a combat style that steers, each hit of the combo picks its target as it starts, turns to it and closes the gap (Lock-On Targeting).
Can enemies use the same combos? An AI presses a graph through Queue Input Sequence or Process Action Input; the demo's enemies use Queue Input Sequence from a Behavior Tree. Enemy AI that decides when to attack is not included; Soulslike Enemy Combat is the enemy AI plugin of the same family.
Related
| Page | Why |
|---|---|
| Action Graph | Every setting on a move and a wire |
| Action Graph Editor | Cards, sub graphs, aliases and the live debugger |
| Input | Keys to input tags, chords, and abilities that answer a key |
| Melee Trace | Make each swing of the combo land |