# Combo System for UE5: Attack Chains, Input Buffering, Branches

> 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.

Markdown version of https://rigbak.com/docs/universal-combat-framework/player/combo-system, a page of the Universal Combat Framework documentation. Link that page when citing it.

> 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 Combat Framework 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](https://rigbak.com/docs/universal-combat-framework/player/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**

   Open `AG_MySword`, right-click the canvas and pick **Add Action Node**. Name it `Heavy` (**Node Name**) and set its **Montage** to `AM_UCF_Sword_Heavy_1`, the demo sword's first heavy. Its trace window sweeps the hit volume named `Blade`, the one `Item_MySword` carries.
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** to `UCF.Input.HeavyAttack`. With both wires in place, Light 1 leads two ways: a light press to Light 2, a heavy press to Heavy.

   Light 1

   AM_Attack_Light

   UCF.Input.LightAttack

   UCF.Input.HeavyAttack

   Failed

   Light 2

   AM_Attack_Light

   Heavy

   AM_Heavy

   Out Of Breath

   AM_Tired

   *Light 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**

   On `Item_MySword`'s **Equippable** fragment, add an **Input Mappings** row: **Input Action** `IA_UCF_HeavyAttack`, **Input Tag** `UCF.Input.HeavyAttack`. `IMC_UCF_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 play `LVL_UCF_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 **UCF 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.

**Timeline: AM_Attack_Light** (1.6 s long). Tracks:

- **Notifies**: UCF Action Window (0.7 s to 1.15 s)
- **Light attack**: pressed (at 0.42 s); Light 2 (at 0.7 s)

*The press lands early, waits, and Light 2 starts as the window opens.*

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](https://rigbak.com/docs/universal-combat-framework/player/action-graph#early-and-late-presses)).

---

## 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 `UCF.Input.Special` for a signature move, while each alone keeps its move ([Chords](https://rigbak.com/docs/universal-combat-framework/player/input#press-two-buttons-together)).

---

## 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

ALIAS UCF.Input.Guard (Interrupt)

3 actions

UCF.Input.Guard

Parry

AM_Parry

Zoom -1 Action Graph

*One alias with Light 1, Light 2 and Light 3 ticked. Compiling copies its one transition onto all three, so a parry is reachable from every step of the combo.*

---

## 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](https://rigbak.com/docs/universal-combat-framework/player/items#equippable-drawing-it)). 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](https://rigbak.com/docs/universal-combat-framework/player/action-graph-editor#fold-one-graph-into-another)).

---

## 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, `UCF.Debug.Actions 1` writes each character's move, its window and any waiting press above its head ([Action Graph Editor](https://rigbak.com/docs/universal-combat-framework/player/action-graph-editor#watch-a-character-run-the-graph)).

<details>
<summary>What happens to one press (Advanced)</summary>

An input enters at the top. The 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.

</details>

<details>
<summary>Combos online (Multiplayer)</summary>

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](https://rigbak.com/docs/universal-combat-framework/player/multiplayer-melee-combat#what-the-server-refuses-beyond-hits) gives the numbers and covers hit checks.

</details>

<details>
<summary>Press a combo from Blueprint or AI (Alternative)</summary>

**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 combo enemies play their item's graph through **Action Graph Combo** actions in their action sets ([Action Graphs in Action Sets](https://rigbak.com/docs/universal-combat-framework/action-graphs-in-action-sets)) ([Action Graph](https://rigbak.com/docs/universal-combat-framework/player/action-graph#drive-a-graph-from-blueprint-or-ai)).

</details>

---

## 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](https://rigbak.com/docs/universal-combat-framework/player/gates-costs-cooldowns)).

**Can one montage hold the whole combo?** Yes. Each card plays one section of it, as the demo sword's `AM_UCF_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](https://rigbak.com/docs/universal-combat-framework/player/lock-on-targeting)).

**Can enemies use the same combos?** Yes. An enemy's action set plays a combo from an action graph, and its AI decides when ([Action Graphs in Action Sets](https://rigbak.com/docs/universal-combat-framework/action-graphs-in-action-sets)).

---

## Related

| Page | Why |
| --- | --- |
| [Action Graph](https://rigbak.com/docs/universal-combat-framework/player/action-graph) | Every setting on a move and a wire |
| [Action Graph Editor](https://rigbak.com/docs/universal-combat-framework/player/action-graph-editor) | Cards, sub graphs, aliases and the live debugger |
| [Input](https://rigbak.com/docs/universal-combat-framework/player/input) | Keys to input tags, chords, and abilities that answer a key |
| [Melee Trace](https://rigbak.com/docs/universal-combat-framework/melee-trace-and-damage) | Make each swing of the combo land |

---

Previous page: [Melee Combat in UE5 Without C++: Blueprints and Data Assets](https://rigbak.com/docs/universal-combat-framework/player/melee-combat-without-cpp). Next page: [Lock-On Targeting in UE5: Switch Targets and Steer Attacks](https://rigbak.com/docs/universal-combat-framework/player/lock-on-targeting)
