# Melee Trace and Damage

> Make a swing connect and decide what it does: trace sockets on the item an enemy or the player holds, a window on the attack montage, the damage config, hit effects, hit stop, and how enemies and the player take a hit.

Markdown version of https://rigbak.com/docs/universal-combat-framework/melee-trace-and-damage, a page of the Universal Combat Framework documentation. Link that page when citing it.

> A weapon that lands its hits, in an enemy's hand or the player's. The item names its hit volumes, a window on the attack montage opens them, the sweep fills the gap between frames, and one damage config says what the blow is worth and what it does when it lands.

## Set it up (3 minutes)

1. **Find the trace component**

   Both character bases carry **UCF Melee Trace**: an enemy built on **UCF Enemy Character Base** as **MeleeTraceComponent**, a character built on the UCF character base as **MeleeTrace**. Each is granted the ability that confirms its hits as its ability system comes up. Nothing to add on either.

   On any other pawn, press **Add Component** and pick **UCF Melee Trace**. A pawn a player controls also calls **Notify Ability System Ready** after its ability system is set up, and again each time that setup runs. A pawn an AI controls deals its hits without it.
2. **Give the weapon its trace sockets**

   A weapon is an item, in an enemy's hand or the player's. Open the item definition, expand its **Equippable** fragment, and add one row to **Trace Sockets**. An item drawn with a **Visuals** mesh and no item actor class of its own wears that mesh on a component tagged `UCF.ItemMesh`, so name that tag.

   In **Item_MySword**, under Equippable > Trace Sockets > Index [ 0 ], set:

   | Property | Value |
   | --- | --- |
   | ID | Blade (replaces None) |
   | Source Component Tag | UCF.ItemMesh (replaces None) |
   | Shape | Capsule Two Point (replaces Sphere) |

   *Socket or Bone Name and End Socket or Bone Name start on TraceStart and TraceEnd. Add sockets by those names to the weapon mesh, from hilt to tip, or point the two fields at sockets it already has.*
3. **Create a damage config**

   Create the asset: right-click in the Content Browser, choose **UCF > Damage and Defense > Damage Config**, and name it **Damage_MySword**.

   *Right-click in the Content Browser, UCF, Damage and Defense, Damage Config.*

   Set **Damage** to 25 and add `UCF.Damage.Physical.Slashing` to **Damage Tags**. Six configs ship under `Core/Damage`, one per kind of damage, `Damage_UCF_Slashing` among them; pick one of those to skip this step.
4. **Open a trace window on the montage**

   Open the attack montage, add a Notify State, and pick **UCF Melee Trace Window**. Drag it across the strike frames. The same window works on an enemy's montage and on the player's.

   In **AM_MySword_Attack**, under Melee Trace, set:

   | Property | Value |
   | --- | --- |
   | Socket IDs | Blade (replaces 0 Array elements) |
   | Damage Config | Damage_MySword |

   *Socket IDs names which sockets sweep. Leave it empty to sweep every registered socket.*
5. **Play, and watch the sweep**

   Press Play and run `UCF.Debug.Melee.DrawTracing 1` in the console. Each swept shape draws while its window is open, an enemy's and the player's alike, and turns yellow on a hit.

> **Warning**
>
> Sockets register as an enemy or the player draws an item, and come off when it leaves the hand, so a swing with nothing in hand sweeps nothing. Check **Starting Items** on the enemy's **Loadout**, and draw the player's item first. Then read the Output Log: the trace names a socket ID a window asked for that nothing registered, and `LogUCFEquipment` an item drawn onto a character carrying no melee trace.

> **Note**
>
> The target decides what a hit costs it. Both character bases answer through their defenses and take what survives off their health; any other actor implementing **UCF Damageable** answers the hit itself, and anything else takes Unreal's point damage. See [Defense](https://rigbak.com/docs/universal-combat-framework/defense).

---

## Shape the sweep

*Interactive diagram on the page: Without Interpolation: The fast sword swings 'teleport' over the target between frames, causing a miss.*

Each socket entry is one contact point on the weapon. Its **Shape** decides what the sweep covers between two frames.

| Shape | Pick it for |
| --- | --- |
| **Sphere** | Fists, pommels, a small contact point. **Radius** (15) is the whole setup. |
| **Capsule** | Widening one contact point's swept path. It lies along the direction the socket traveled, so **Capsule Half Height** lengthens the sweep rather than the weapon. |
| **Capsule Two Point** | A blade from hilt to tip. It spans **Socket or Bone Name** to **End Socket or Bone Name** and sizes itself. |

Add an entry per contact point and give each its own **ID**. A blade and a pommel can then trace in different windows of the same montage.

The first frame after a window opens records positions only. The sweep starts on the frame after that, once it holds a previous sample to sweep from. A window that opens on a mesh nothing was drawing, such as a character behind the camera, starts a frame later still, since that mesh shows an older pose until its next update. The trace keeps the mesh animating for as long as the window stays open, so the rest of the swing sweeps the live pose.

---

## The montage window

**Details panel: UCF Melee Trace Window** (anim notify, in AM_MySword_Attack)

**Category: Melee Trace**

| Property | Value |
| --- | --- |
| Socket IDs | 1 Array element |
| Socket IDs > Index [0] | Blade |
| Damage Config | Damage_MySword |
| Extra Damage Tags | no tags |

**Category: Debug**

| Property | Value |
| --- | --- |
| Enable Debug Draw | false |

*Notify state over the strike frames, on an enemy's attack montage or the player's. Empty Socket IDs sweeps every registered socket.*

Leave **Socket IDs** empty and the window sweeps every socket the wielder has registered. Fill it in and the names have to match a socket **ID** exactly.

**Extra Damage Tags** describe this swing on top of what its damage config carries, so one config serves a whole combo whose windows differ in kind: three light slashes marked counterable, a finisher marked unblockable. A guard reads them alongside the config's own, and a telegraph window on the same montage announces them too.

One component traces one window at a time. Two windows overlapping on the same montage close the first and log that the earlier one ended, naming the actor it was open on, so space them apart or fold them into one.

---

## Damage per attack

**Details panel: UCF Damage Config** (data asset, in Damage_MySword)

**Category: Damage**

| Property | Value |
| --- | --- |
| Damage | 25 |
| Additional Vital Damage | 0 Array elements |
| Damage Type | None |
| Damage Type Class | None |
| Damage Tags | UCF.Damage.Physical.Slashing |
| Multi Hit Interval | -1 |
| Max Targets Per Swing Override | -1 |
| Use Authored Hit Direction | false |

**Category: Hit Effects**

| Property | Value |
| --- | --- |
| Hit Effects | 0 Array elements |

*One attack's damage, tags and hit effects, for an enemy's swing or the player's. Name it on the attack's trace window, or as the trace component's Default Damage Config.*

Three places can answer for a window's damage, and the first one filled in wins: the notify's **Damage Config**, then **Default Damage Config** on the component, then **Base Damage** (10).

**Damage Tags** name the kind of damage so a target can resist or react by kind, and carry anything else a target reacts to, such as a backstab or an unblockable swing. Two sets of kinds ship. The six configs under `Core/Damage` name what the damage is:

| Physical | Elemental |
| --- | --- |
| `UCF.Damage.Physical.Slashing` | `UCF.Damage.Elemental.Fire` |
| `UCF.Damage.Physical.Piercing` | `UCF.Damage.Elemental.Ice` |
| `UCF.Damage.Physical.Bludgeoning` | `UCF.Damage.Elemental.Lightning` |

The demo's weapons, in an enemy's hand or the player's, name `UCF.DamageType.Slash` and `UCF.DamageType.Blunt`. Tags match down the tree, so armor checking `UCF.Damage.Physical` answers every physical kind, and armor checking `UCF.DamageType` every kind beneath that root. The two sets sit under different roots and do not match each other, so keep a project's attacks and its defense rules on one set, or add kinds of your own under a root of your own. A [defense response](https://rigbak.com/docs/universal-combat-framework/defense) reads them through its **Required Attack Tags** and **Blocked Attack Tags**.

**Damage Type** above **Damage Tags** is deprecated and still read as one of the attack's tags; leave it empty and name the kind in **Damage Tags**. **Damage Type Class** is the engine damage type a hit carries to a target that takes Unreal's point damage rather than answering through **UCF Damageable**. Leave it unset unless such a target reads it.

**Additional Vital Damage** drains vitals beyond health, one row per vital: 10 off stance while **Damage** takes 50 off health. A target carrying no matching row ignores that row, so one attack works against a boss with stance and a basic enemy without.

---

## What a swing lands on

Each contact is sorted into one of three kinds, and that decides what the hit costs the swing.

| Kind | What it is | Damage | The swing |
| --- | --- | --- | --- |
| **Damageable** | A live target. | Sent. | Spent on it. |
| **Inert** | A combatant taking nothing right now: a pawn with Can be Damaged switched off, such as a corpse. | None. | Spent, and reachable again the moment the target starts taking hits. |
| **Scenery** | The level: a wall, a floor, a prop out of combat. | None. | Held for the whole window, so a wall costs one clang. |

A character a **UCF Invulnerable** defense response protects stays **Damageable**: the hit is sent, and its defense answers it.

Two switches on the component decide the sorting. **Respect Can be Damaged** is on by default, so switching Unreal's Can be Damaged flag off on death is all a corpse needs to go quiet. **Require Damageable Target** sends no damage to anything without **UCF Damageable**: a pawn sorts as **Inert** and anything else as **Scenery**, for a project whose weapons should land nothing on props. Leave it off and a breakable crate wired through Any Damage keeps taking hits.

---

## What a landed hit does

**Hit Effects** on the damage config are everything beyond the number. Add one row per thing the attack should do.

| Effect | Does |
| --- | --- |
| **UCF Play Gameplay Cues** | Fires cues on the attacker and on the target: sparks, blood, impact sounds, decals. |
| **UCF Apply Physics Impulse** | Shoves the struck body along the blow. Set **Hit Bone Force** for the limb, **Hit Overall Force** for the whole body, **Hit Rotational Force** to send it tumbling. |
| **UCF Apply Gameplay Effect** | Grants a gameplay effect to either character: a counter window on the one that parried, a stagger on the one that was struck. |
| **UCF Hit Stop** | Holds the drawn pose of the characters it names for a moment, so a heavy blow reads as heavy. See [Hit stop](https://rigbak.com/docs/universal-combat-framework/melee-trace-and-damage#hit-stop). |
| **UCF Send Gameplay Event** | Sends a gameplay event to either character, which an ability triggered by that tag answers: a flinch on the one struck, a recoil on the one whose blow was parried. |
| **UCF Impact Slow** | Slows the attacker's swing for a moment when it strikes a wall, a prop or heavy armor. See [Make a swing bite](https://rigbak.com/docs/universal-combat-framework/melee-trace-and-damage#make-a-swing-bite). |
| **UCF Play Physical Reaction** | Moves the struck character's bones under physics, so a hit knocks a shoulder or a head back. Needs a **UCF Physical Reaction** component on the target. |

**Affected Sides** on every effect picks who it reaches: the character that swung, the one that was struck, or both. Tick both and one row serves them together, so a heavy blow freezes both characters from a single entry. **UCF Apply Physics Impulse** reads the struck body's own collider and bone, so it reaches the struck character alone, and the asset says so if you tick the attacker. **UCF Play Physical Reaction** reaches the struck character alone too, and **UCF Impact Slow** the attacker alone.

Each effect picks which kinds of hit it runs on. **Run on Damageable Hits** is on, **Run on Inert Hits** and **Run on Scenery Hits** are off, so a corpse and a wall stay silent until you give them an effect of their own.

Give a cue effect a **Surface Set** and the struck material picks the variant, so a blade on stone plays something other than a blade on flesh. Map each physical material or surface type to a name, and that name goes on the end of the authored cue tag: `GameplayCue.Impact` becomes `GameplayCue.Impact.Stone` when the project has a gameplay tag by that name, and plays as authored when it has none.

An effect can also sit a hit out. **Suppress on Result Tags** skips it for what the target reported, **Require Any Result Tags** gives a parry its own sparks, **Require Any Target Tags** and **Suppress on Target Tags** read the target's current state, and **Require Damage Applied** holds the effect back unless health came off.

> **Note**
>
> A cue fired this way receives the impact point, the impact normal, the struck surface, the damage that landed, a fatal flag, and whatever the target reported. One notify can read those and branch a parried or blocked hit instead of needing a cue per outcome.

The demo's hit sparks, sounds and camera shakes are gameplay cues the plugin loads while **Load Demo Hit Effects** is ticked, under Project Settings, Plugins, Universal Combat Framework Demo. Ticked, they also go into a packaged game. Untick it to ship a game without the demo's cues: they neither load nor go into the package. The change applies the next time the editor or the game starts.

<details>
<summary>Effects on the attacking player's own machine (Multiplayer)</summary>

**Can Play Ahead** on every effect says whether the attacking player's own machine plays it the moment the swing connects, before the server has answered the hit. It matters only for a player who predicts their own swings. It answers true unless the effect waits on that answer, which **Suppress on Result Tags**, **Require Any Result Tags** and **Require Damage Applied** all do. An effect only the server can carry out, such as **UCF Apply Gameplay Effect** or **UCF Send Gameplay Event**, never plays ahead.

An effect that waits runs on the server, which sends it to the attacking player's machine a moment after contact. An impact that plays ahead and a parry spark that waits can sit side by side, so a parried blow shows the impact at contact and the spark once the answer arrives. A Blueprint effect overrides **Can Play Ahead** to return false for work that has to run on the server alone; decide it from the effect's own settings, since the attacker's machine asks before any answer exists.

</details>

---

## Hit stop

A heavy blow reads as heavy when both characters freeze for a moment. Add **UCF Hit Stop** to the attack's **Hit Effects** and tick both sides under **Affected Sides**. It holds the drawn pose of each character it names for **Hold Seconds**; the montage, its windows and its movement run on schedule underneath, so the combo keeps its timing.

**Details panel: UCF Hit Stop** (instanced object, in Damage_MySword > Hit Effects)

**Category: Hit Stop**

| Property | Value |
| --- | --- |
| Hold Seconds | 0.05 |
| Fatal Hold Multiplier | 1.5 |
| Surface Scaling | None |

*Holds the drawn pose of the characters ticked under Affected Sides. Each needs a UCF Anim Manager and a UCF Hit Stop node in its Animation Blueprint.*

A character holds only while it carries a **UCF Anim Manager** and its Animation Blueprint has the **UCF Hit Stop** node after the montage slot, with an **Inertialization** node after it to blend the pose back. A character built on the UCF character base and an enemy built on **UCF Enemy Character Base** carry the Anim Manager. An enemy built straight on **Enemy Character Base** does not, so one that should hold needs a **UCF Anim Manager** added beside the node. Without either one, nothing holds on that character. [Animation Integration](https://rigbak.com/docs/universal-combat-framework/animation-integration) shows the node in place.

| Field | Sets |
| --- | --- |
| **Hold Seconds** | The hold on an ordinary hit, in seconds. 0 holds nothing. |
| **Fatal Hold Multiplier** | Lengthens the hold on a killing blow, so a finisher lands heavier than a chip hit. |
| **Surface Scaling** | Scales the hold by what was struck. **Density** reads the struck material's density through **Density Hold Curve**; **Surface Type** looks the surface up in **Surface Hold Multipliers**. **None** holds every surface the same. |

**Max Hit Stop Seconds** in Project Settings, Plugins, Universal Combat Framework caps every hold at 0.3 seconds by default, and 0 turns hit stop off for the whole project. Untick **Hit Stop Enabled** on a character's **UCF Anim Manager** to keep that character moving through hit stops, such as an enemy that should not stall on its own blows.

<details>
<summary>When a hold ends early (Advanced)</summary>

A hold ends early when the mesh's montage ends or another replaces it, the action graph moves to another node, the character enters or leaves a paired action, the body goes to ragdoll, or **Release Hit Stop** runs. A hit landing during a hold extends it. **Is Holding** and **Is Mesh Held** on the Anim Manager answer whether a hold runs.

</details>

<details>
<summary>Hit stop on each machine (Multiplayer)</summary>

A dedicated server holds nothing, and a listen server holds only the character its own player controls, since a server judges every other character's hits from the pose it holds. The attacking player's machine holds the moment the swing connects, before the server knows whether the blow was fatal, so a killing blow holds there for the ordinary length; every other machine plays the server's hold with the multiplier. A struck character holds on every machine showing it.

A window on **UCF Melee Trace** that ends while its pose is held keeps sweeping until the pose is back, at most twice **Max Hit Stop Seconds**, so the rest of the swing still lands. The base trace an enemy built straight on **Enemy Character Base** carries closes a window at its end.

</details>

---

## Make a swing bite

A blade that bites into a wall, or drags through heavy armor, slows down for a moment and the next attack follows a little later. Add **UCF Impact Slow** to the attack's **Hit Effects**.

**Details panel: UCF Impact Slow** (instanced object, in Damage_MySword > Hit Effects)

**Category: Impact Slow**

| Property | Value |
| --- | --- |
| Relative Rate | 0.40 |
| Duration | 0.12 |

**Category: Hit Effect**

| Property | Value |
| --- | --- |
| Run on Damageable Hits | false |
| Run on Inert Hits | true |
| Run on Scenery Hits | true |

*Slows the attacker's swing after its first qualifying contact. Answers walls, props and bodies taking nothing by default.*

**Relative Rate** is how fast the attack plays after contact, as a share of its normal speed: 0.4 plays it at 40 percent. **Duration** is how long that lasts, in seconds; the slow also ends with the attack. By default it answers walls, props and bodies that take no damage. To slow on a target in heavy armor, tick **Run on Damageable Hits** and put the armor's tag in **Require Any Target Tags**, a tag the target holds through a gameplay effect so the attacker's machine and the server both see it.

Only the first contact that qualifies slows an attack, and later contacts in the same swing change nothing. The slow does not carry into the next attack.

> **Warning**
>
> Impact Slow slows only swings an action graph node plays; another ability's swing goes on at full speed and the log names it once. A montage with a time stretch curve cannot be slowed, and the action graph reports it when saved.

<details>
<summary>Why it refuses result gates (Advanced)</summary>

The slow starts the moment the blade makes contact, before the target has answered the hit, so it cannot wait on that answer. The asset reports an error when **Suppress on Result Tags**, **Require Any Result Tags** or **Require Damage Applied** is set on it. A slow for a parried or blocked blow belongs in the attacker's recoil reaction instead.

</details>

<details>
<summary>Impact Slow on each machine (Multiplayer)</summary>

The attacking player's machine slows its swing the moment it sees the contact, and the server slows its own copy when the hit report arrives, which is what other players see. Each machine judges the contact by its own view, and the server slows even a hit its checks refuse. A report that reaches the server after its copy of the swing ended leaves only the attacking player's machine slowed; the server keeps a finished attack's follow-ups open long enough for the slowest a contact could have made the player's copy.

</details>

---

## How often a swing lands

**Hit Reset Interval** (0) is the wait before the same target can be hit again inside one window. At 0 a swing lands once per target, which is what a single slash wants. Set 0.15 for a spin or a drill that keeps hitting.

**Max Targets Per Swing** (0) is how many targets one swing cuts through. 0 cuts through everything, 1 makes every swing single-target so a stab cannot clip the enemy standing behind. Only a target the swing lands damage on counts; tick **Scenery Counts Toward Swing Limit** and walls, floors and props count too, so a stab stops at the first thing it meets.

Both have a per-attack override on the damage config, for an attack whose rate or reach differs from the rest of the weapon's: **Multi Hit Interval** and **Max Targets Per Swing Override**. Leave them at `-1` to use the component's values.

Two tag lists on the component decide what a target can do about it.

| List | Effect on the swing |
| --- | --- |
| **Pass Through Tags** | The sweep drops the contact entirely: no damage, no impact effect, and the swing carries on to whatever stands behind. Holds `UCF.State.Intangible` by default, which a **UCF State Tag Window** on a dodge montage grants. |
| **Skip Record Tags** | The hit resolves, the target reports back, and the swing is left unspent so it can connect again on a later frame. Empty records every resolved hit, so a parry or a block costs the attacker that swing. |

---

## Who a swing can hit

**Team Filter** decides which actors a sweep is allowed to damage, separately from combat target selection.

**Details panel: UCF Melee Trace (Base)** (component, in Enemy Character Base (MeleeTraceComponent))

**Category: Damage**

| Property | Value |
| --- | --- |
| Team Filter | No Filter |

*The trace of an enemy built straight on Enemy Character Base. Starts on No Filter, so its swing hits anyone, its own pack included. Set Enemies Only to spare teammates.*

**Details panel: UCF Melee Trace** (component, in UCF Character Base (MeleeTrace), UCF Enemy Character Base (MeleeTraceComponent))

**Category: Damage**

| Property | Value |
| --- | --- |
| Team Filter | Enemies Only |

*Starts on Enemies Only, so a swing spares teammates, the player's and an enemy's alike. Filters who a swing can damage, separate from targeting.*

**No Filter** hits anyone. **Enemies Only** hits hostiles and neutrals, so a pack does not carve itself up. **Friendlies Only** suits a healing or buffing weapon, and **Neutral Only** hits actors with no team, plus any the attacker's team component excludes. Team state comes from the pawn's **UCF Team** component. **UCF Melee Trace**, which the player's character and every enemy built on **UCF Enemy Character Base** swing, starts on **Enemies Only**, so a swing spares teammates and still hits anything with no team; set **No Filter** for friendly fire. An enemy built straight on **Enemy Character Base** keeps the base trace, which starts on **No Filter**, so it hits its own pack until set to **Enemies Only**.

**Trace Filter** decides what the sweep reaches at all. **Channel** mode sweeps the Pawn channel and lets each target's collision response answer, so a blocking wall shields whatever stands behind it. **Object Types** mode names categories outright and nothing stops the sweep, which is how an attack reaches a ragdoll whose physics asset ignores the Pawn channel.

> **Warning**
>
> **Object Types** mode reports every listed target along the whole span, including one standing behind a wall. Use **Channel** mode whenever the level should shield anything.

A trigger box in the level never stops a swing, in either mode. A component with no physics collision that lets pawns walk through it, on an actor that is neither a pawn nor **UCF Damageable**, is passed through, so a swing inside a trigger volume still reaches the enemy standing in it. An overlap-only hit box on a character still takes the blow; a prop that should notice a swing without stopping it takes one of **Sense Component Tags** instead.

The wielder and everything attached to it are already out of the sweep. **Add Trace Ignored Actor** takes out one more, for a mount or a summoned companion the swing should pass through.

---

## Tune the component

**Details panel: UCF Melee Trace (Base)** (component, in Enemy Character Base (MeleeTraceComponent))

**Category: Damage**

| Property | Value |
| --- | --- |
| Default Damage Config | None |
| Base Damage | 10 |
| Damage Type Class | None |
| Hit Reset Interval | 0 |
| Max Targets Per Swing | 0 |
| Scenery Counts Toward Swing Limit | false |
| Team Filter | No Filter |

**Category: UCF > Melee Trace > Damage**

| Property | Value |
| --- | --- |
| Pass Through Tags | UCF.State.Intangible |
| Skip Record Tags | no tags |
| Sense Component Tags | 0 Array elements |
| Damage Application | Damageable Interface |
| Respect Can be Damaged | true |
| Require Damageable Target | false |

**Category: Trace**

| Property | Value |
| --- | --- |
| Trace Filter > Mode | Channel |
| Trace Filter > Trace Channel | Pawn |
| Sub Step Distance | 10 |
| Max Sub Steps | 20 |

**Category: Debug**

| Property | Value |
| --- | --- |
| Draw Debug | false |
| Debug Draw Duration | 0.1 (greyed out) |

*Created on an enemy built straight on Enemy Character Base, and sweeps on the server. UCF Enemy Character Base carries UCF Melee Trace in its place.*

**Details panel: UCF Melee Trace** (component, in UCF Character Base (MeleeTrace), UCF Enemy Character Base (MeleeTraceComponent))

**Category: Damage**

| Property | Value |
| --- | --- |
| Default Damage Config | None |
| Base Damage | 10 |
| Damage Type Class | None |
| Hit Reset Interval | 0 |
| Max Targets Per Swing | 0 |
| Scenery Counts Toward Swing Limit | false |
| Team Filter | Enemies Only |

**Category: UCF > Melee Trace > Damage**

| Property | Value |
| --- | --- |
| Pass Through Tags | UCF.State.Intangible |
| Skip Record Tags | no tags |
| Sense Component Tags | 0 Array elements |
| Damage Application | Damageable Interface |
| Respect Can be Damaged | true |
| Require Damageable Target | false |

**Category: Trace**

| Property | Value |
| --- | --- |
| Trace Filter > Mode | Channel |
| Trace Filter > Trace Channel | Pawn |
| Sub Step Distance | 10 |
| Max Sub Steps | 20 |
| Confirmed Hit Ability Class | UCFConfirmedHitAbility |

**Category: Debug**

| Property | Value |
| --- | --- |
| Draw Debug | false |
| Debug Draw Duration | 0.1 (greyed out) |

**Category: Multiplayer**

| Property | Value |
| --- | --- |
| Hit Detection Authority | Project Default |

*Created on every character built on the UCF character base and every enemy built on UCF Enemy Character Base. Add UCF Melee Trace to any other pawn that swings.*

**Sub Step Distance** (10) is how finely the sweep is chopped between two frames, and **Max Sub Steps** (20) caps the count. Lower the distance for a very fast weapon that still slips past thin targets.

---

## On an enemy: the item and the server's sweep

An enemy built on **UCF Enemy Character Base** carries **UCF Melee Trace**, the player's own trace, named **MeleeTraceComponent** in its components. The server sweeps the enemy's swings, and each hit goes through the confirmed hit ability there, the same step a player's hit takes, before it deals damage. The base grants that ability at Begin Play. An enemy built straight on **Enemy Character Base** carries the base trace, **UCF Melee Trace (Base)**, which deals each hit on the server as it sweeps it, with no confirming step.

### Where an enemy's swings sweep from

An enemy holds the player's items, so its hit volumes come from the item in its hand: the **Trace Sockets** rows on the item's **Equippable** fragment register on the enemy's melee trace as the item is drawn, and come off as it leaves the hand, exactly as [on the player](https://rigbak.com/docs/universal-combat-framework/melee-trace-and-damage#hit-volumes-from-items). **Starting Items** on the enemy's **Loadout** draws an item as the enemy begins play, and the Equipment Manager's **Default Item** covers bare hands. [Enemy Weapons](https://rigbak.com/docs/universal-combat-framework/enemy-weapons) covers arming the enemy.

### How an enemy takes a hit

Enemy Character Base answers a hit through its **Defense** component and takes what survives off the health pool that **Health Vital Tag** names under Project Settings, Plugins, Universal Combat Framework Enemy, Vitals (`UCF.Vital.Health` by default). With **Report Damage to Perception** on, its default, it also tells the enemy's perception who struck it, so a blow from behind reveals the attacker while the enemy's **Awareness Config** has **Enable Damage Sense** on. It starts no flinch of its own: override **Handle Incoming Damage** in the enemy Blueprint and call **Resolve Enemy Damage**, which also reports the hit to the enemy's reactions.

**UCF Enemy Character Base** calls **Resolve Enemy Damage** itself, so its reactions and its perception hear each hit once, and a hit that empties its health drops the body limp through its **UCF Physical Reaction**. A Blueprint override of **Handle Incoming Damage** keeps both by calling the parent. [Defense](https://rigbak.com/docs/universal-combat-framework/defense) covers the answers, and [Reaction System](https://rigbak.com/docs/universal-combat-framework/enemy/reaction-system) the flinches.

### The demo enemies' hits

An enemy holding the baton deals the player's baton damage, `Damage_UCF_TwoHanded`, and one fighting with its fists `Damage_UCF_Unarmed`, the configs the player's own swings use. They play `GameplayCue.UCF.Hit` cues through **UCF Play Gameplay Cues**, with `ImpactSurfaces_UCF_Default` picking the variant by surface, and their hits drain the struck character's poise, so an enemy's blows flinch the player as the player's flinch an enemy.

---

## On the player: items and the confirmed hit

A character built on the UCF character base carries **UCF Melee Trace**, named **MeleeTrace**. Its items bring the hit volumes, one ability checks each hit before it deals damage, and in multiplayer **Hit Detection Authority** picks the machine that sweeps.

### Hit volumes from items

An item carries its own hit volumes, so a sword, a shield bash and a pair of fists each bring theirs. The **Trace Sockets** rows on the item's **Equippable** fragment register on the character's melee trace as the item is drawn, and come off as it is put away.

**Details panel: Trace Socket** (data asset, in Item_MySword > Equippable)

**Category: Trace**

| Property | Value |
| --- | --- |
| ID | Blade |
| Source Component Tag | UCF.ItemMesh |
| Shape | Capsule Two Point |
| Socket or Bone Name | TraceStart |
| End Socket or Bone Name | TraceEnd |
| Radius | 15 |
| Trace Filter Override > Mode | Channel (folded until clicked) |
| Trace Filter Override > Trace Channel | Pawn (folded until clicked) |

**Category: Debug**

| Property | Value |
| --- | --- |
| Debug Color | R 1, G 0, B 0, A 1 (sRGB) |

*One row of the Equippable fragment's Trace Sockets. Drawing the item registers it on the character's melee trace; putting it away takes it off.*

**Source Component Tag** says which mesh a row rides:

- **Empty** follows the character's own body mesh, which is how bare hands trace: name a bone such as `hand_r` and nothing else.
- **A component tag** looks first on the drawn item's own actor, then on the character and everything attached to it. `UCF.ItemMesh` names the mesh an item shows when its **Visuals** fragment has a mesh and it names no item actor class. A weapon Blueprint of your own tags its mesh component and names that tag.

Two copies of one item held at once cannot share an ID, so the ID names the place it is held in. An item in the first place its **Hold Places** lists registers as authored, `Blade`; one in any other place adds that place's name, `Blade_Off` or `Blade_Back_Left`. A window that sweeps every socket catches both, and one naming a single socket uses those names.

An enemy's items register the same way. The demo's sword is `Item_UCF_Sword`. Its damage config, `Damage_UCF_Sword`, plays `GameplayCue.UCF.Hit.Slash` with `ImpactSurfaces_UCF_Default` as its **Surface Set**. [Items](https://rigbak.com/docs/universal-combat-framework/player/items) covers the item definition and its fragments.

### The ability that confirms a hit

Every hit **UCF Melee Trace** finds goes through one ability before it deals damage: the class named by **Confirmed Hit Ability Class** on the trace. A character built on the UCF character base is granted it as its ability system comes up, and an enemy built on **UCF Enemy Character Base** at Begin Play, so either deals damage with nothing authored. In single player it deals each hit the moment the sweep finds it.

To react to every landed hit, make a Blueprint child of `UCFConfirmedHitAbility`, override **On Hits Confirmed**, and call the parent so the hits still deal their damage. Then set the child as the trace's **Confirmed Hit Ability Class**. Grant it once: two abilities answering one hit each deal damage, and the trace warns.

**Details panel: Class Defaults** (Blueprint, in GA_MyConfirmedHit)

**Category: UCF > Confirmed Hit**

| Property | Value |
| --- | --- |
| Hit Validators | 4 Array elements |
| Hit Validators > Index [0] | Melee Trace Window |
| Hit Validators > Index [0] > Grace Seconds | 0.50 |
| Hit Validators > Index [1] | Pass Through |
| Hit Validators > Index [2] | Plausible Hit |
| Hit Validators > Index [2] > Extra Reach | 150 |
| Hit Validators > Index [3] | Rewind Hit |
| Hit Validators > Index [3] > Max Rewind Seconds | 0.50 |
| Hit Validators > Index [3] > Time Tolerance | 0.10 |
| Hit Validators > Index [3] > Distance Tolerance | 30 |
| Untied Hit Spacing | 0.5 |

*A Blueprint child of the ability, set as UCF Melee Trace's Confirmed Hit Ability Class. These are the defaults it inherits.*

**Hit Validators** run on the server over every hit before it deals damage. A hit stops at the first check that refuses it, and a refused hit deals nothing.

| Check | Refuses a hit when |
| --- | --- |
| **Melee Trace Window** | A player's machine reported it, and the attacker's montage is not playing the trace window the hit names, within **Grace Seconds** of its span. |
| **Pass Through** | The target holds one of the attacker's **Pass Through Tags**, such as a dodge's `UCF.State.Intangible`. |
| **Plausible Hit** | A player's machine reported it, and the target is the attacker itself or something it carries, a teammate the **Team Filter** spares, or farther than the attacker's trace sockets reach plus **Extra Reach** and the movement a round trip explains. |
| **Rewind Hit** | A player's machine reported it on a target carrying a **UCF Rewind History**, and its impact point lay farther than **Distance Tolerance** from the target where that player's screen showed it, about a round trip earlier. It passes a hit on a target without the component. |

A player's screen shows other characters a little behind the server. To check reported hits against where the player saw the target, add **UCF Rewind History** to each character a remote player can hit, enemies included; the server then keeps a short record of where it stood. **Rewind History Seconds** (1 second) and **Rewind Memory Budget MB** (8 MB) in Project Settings, Plugins, Universal Combat Framework set how far back the record reaches and the memory it may use.

Melee Trace Window, Plausible Hit and Rewind Hit pass a hit the server swept itself; a check of your own reads **Swept Here** on its context to do the same. A hit that passes every check still lands only as often, and on as many targets, as its window lets one swing land. **Untied Hit Spacing** is the shortest time between two reported hits on one target that belong to no montage window, such as hits from a trace started by hand.

### How the player takes a hit

A character built on the UCF character base answers every hit with nothing authored. Its **UCF Defense** component works out what the blow is worth, what survives comes off the pool its **Health Vital Tag** names, and **On Damage Taken** runs with the blow and what landed. **Health Vital Tag** is `UCF.Vital.Health` by default, and the character starts carrying a pool for it at 100. See [Defense](https://rigbak.com/docs/universal-combat-framework/defense) for the answers and [Vitals](https://rigbak.com/docs/universal-combat-framework/vitals) for the pools.

**On Damage Taken** is where a game reacts. Override it in the character Blueprint to play a flinch, route a death, or send a gameplay event. Its **Result** carries **Was Fatal**, true on the hit that emptied the health pool, and the pools have already drained when it runs. A character with Unreal's Can be Damaged switched off takes nothing.

<details>
<summary>Answering a hit your own way (Advanced)</summary>

The character answers through **Handle Incoming Damage**, a function of the **UCF Damageable** interface; it returns a value, so a Blueprint implements it as a function graph rather than an event. Override it to change the answer, and call **Resolve Incoming Hit** inside the override for the standard one before doing more with it. Return the damage that landed and the tags describing what happened, so the attacker's trace decides from that whether the swing is spent.

Do not destroy the character from **Handle Incoming Damage**: the attacker is still resolving the hit, so a torn-down actor loses its own impact cues and its push. Call **Set Life Span**, or destroy it on the next tick.

</details>

<details>
<summary>On Damage Taken in multiplayer (Multiplayer)</summary>

**On Damage Taken** runs on the server alone, since only the server takes damage. Replicate whatever it starts, or start it from a gameplay cue, so every machine sees it.

</details>

---

## One hit, both ways

Every swing ends in the same step, whichever side swings. Both swing **UCF Melee Trace**, which hands each hit to the confirmed hit ability: an enemy's hits are swept and dealt on the server, and a hit a player's machine swept is checked there first. That step builds the damage from the window's **Damage Config**, asks the struck actor's **UCF Damageable** answer or falls back to Unreal's point damage, and runs the config's **Hit Effects** with what the target reported. Both character bases answer through the same defense step, which walks their defense responses and then drains their vitals.

- **One config serves both sides.** A **Damage Config** describes the hit whichever side deals it, so the config on the player's sword works on an enemy's weapon, and the other way round.
- **One item serves both sides.** An item drawn through a **UCF Equipment Manager** registers its sockets on whichever melee trace the character carries, so the baton the player picks up swings the same in an enemy's hand. Every demo enemy holds the player's own items.
- **One dodge passes both.** Both traces start with `UCF.State.Intangible` in **Pass Through Tags**, so one **UCF State Tag Window** on a dodge montage passes the swings of either side.
- **One team check.** Both traces ask the same team check through **Team Filter**. The player's and the one on **UCF Enemy Character Base** start on **Enemies Only**, so a pack's swings pass over its own members. An enemy built straight on **Enemy Character Base** starts on **No Filter**; set it to **Enemies Only** to spare its own pack.
- **Two sets of damage kinds and cues.** The enemy layer names its kinds under `UCF.Damage` and its cues under `GameplayCue.UCF.Enemy.Hit`; the player layer names its kinds under `UCF.DamageType` and its cues under `GameplayCue.UCF.Hit`. The demo's weapons, the enemies' included, use the player layer's. A rule or an effect reading one set misses attacks tagged with the other, so keep a project's attacks and defenses on one.
- **Two health settings.** An enemy on Enemy Character Base loses the pool Project Settings names; a character on the UCF character base loses the pool its own **Health Vital Tag** names. Both start on `UCF.Vital.Health`.

[Seam Patterns](https://rigbak.com/docs/universal-combat-framework/seam-patterns#one-damage-path-both-ways) shows hits both ways in the demo.

---

## Debug it

```
UCF.Debug.Melee.DrawTracing 1
```

The swept shape draws in the socket's **Debug Color** and changes on a hit. For one character alone, tick **Draw Debug** on its component; **Debug Draw Duration** (0.1 seconds) is how long each shape lingers. For one window alone, tick **Enable Debug Draw** on that notify.

The component reports its own faults, so read the Output Log before hunting. It names a socket a window asked for that nothing registered, a window that opened while another was still open, an **Object Types** filter with an empty list, and a sensor collider blocking the trace channel.

Filter the Output Log to `LogUCFDamage` for the trace and its hit effects. Beside the trace's own faults it names a hit effect missing what it needs (a **UCF Send Gameplay Event** with no **Event Tag**, a **UCF Apply Gameplay Effect** with no effect), two abilities answering one hit, and an **Impact Slow** on a swing no action graph plays. An item's sockets report under `LogUCFEquipment`, in an enemy's hand or the player's. Data validation on a damage config reports an empty **Hit Effects** row, a side an effect cannot reach, and a hit stop longer than **Max Hit Stop Seconds**.

<details>
<summary>Nothing lands (Advanced)</summary>

| Problem | Likely cause | Fix |
| --- | --- | --- |
| No hits at all | **Socket IDs** on the notify name nothing registered | Match the names to a socket **ID**, or clear the list to sweep everything. |
| An enemy hits nothing | It holds no item with **Trace Sockets** | Fill **Starting Items** on the enemy's **Loadout**, or give its **Equipment Manager** a **Default Item**, so the item's sockets register as the enemy begins play. The Output Log names an item drawn onto a character carrying no melee trace. |
| The player hits nothing | The item is not drawn | An item's **Trace Sockets** register as it is drawn and come off as it is put away. Draw it first, and check the Output Log, which names an item drawn onto a character carrying no melee trace. |
| A client player's swings deal nothing | Nothing on that player's machine confirms the hit | The trace warns once. A character built on the UCF character base is granted the trace's **Confirmed Hit Ability Class** as its ability system comes up; any other pawn with **UCF Melee Trace** calls **Notify Ability System Ready** after its ability system is set up, and again each time that setup runs. |
| Misses the first active frame | Warm-up | Expected. The sweep needs a previous position sample. A window that opens on a mesh nothing was drawing starts a frame later. |
| Hits through walls | **Trace Filter** on **Object Types** | Nothing stops that sweep. Switch to **Channel** mode for occlusion. |
| A wall plays the flesh cue | The wall sorts as a live target | A wall with Can be Damaged on and no interface reads as **Damageable**. Switch the flag off on level geometry, or tick **Require Damageable Target**. |
| A corpse keeps ringing | An effect runs on inert hits | Untick **Run on Inert Hits** on that effect, or switch Can be Damaged off on death so the body sorts as inert. |
| Two hits from one swing | **Hit Reset Interval** above zero, or two windows overlapping | One target takes one hit per window at zero. Check the interval, the config's **Multi Hit Interval**, and the log for an overlap warning. |
| The hit is detected but nothing takes damage | The target answers nothing | Implement **UCF Damageable** on it, or leave **Damage Application** on **Damageable Interface** so the point damage fallback runs. |

</details>

<details>
<summary>Colliders the swing reports instead of hitting (Advanced)</summary>

A collider can sit in front of a character without taking the swings that cross it: a parry box, a volume that wakes something up, a hitbox your own code counts.

1. Tag that collider's component.
2. List the tag under **Sense Component Tags** on the trace component.
3. Set the collider's response to the trace channel to **Overlap**.

A swing crossing it fires **On Melee Sensed** carrying the struck component, spends nothing, and reaches the body behind it in the same frame. Each sensor reports once per window however many frames the swing spends inside it.

On **Block** the sweep stops at the sensor and never reaches the body. The Output Log warns and names the component when that happens.

Leave **Sense Component Tags** empty and every contact counts as a body.

</details>

<details>
<summary>Where the blow came from (Advanced)</summary>

Every hit carries the bearing from attacker to target, which is what a directional guard or a reaction reads. **Is Hit Direction Within Arc** answers whether it arrived inside a front arc of a given half angle, and **Get Hit Direction Quadrant** buckets it into Front, Back, Left or Right.

Tick **Use Authored Hit Direction** on the damage config to send a fixed direction instead, so an uppercut launches upward whatever the geometry said. **Authored Hit Direction Local** is that direction in the attacker's local space, and `(0,0,1)` throws the target up. The physics impulse follows the same value.

</details>

<details>
<summary>A socket with its own reach (Advanced)</summary>

Sockets take the component's **Trace Filter** by default. Tick the box beside **Trace Filter Override** on one entry and fill it in to give that contact point its own rule, for a pickaxe head that also breaks rocks while the haft keeps the ordinary filter.

</details>

<details>
<summary>Changing one phase of the pipeline (Advanced)</summary>

Make a Blueprint child of **UCF Melee Trace** and override the event for the phase you want to change. Every other phase carries on as it is. A pawn of your own carries that child in place of the trace. The UCF character base and **UCF Enemy Character Base** create their trace in C++, so a character built on either takes the child through a C++ subclass that names it for the **MeleeTrace** or the **MeleeTraceComponent** component.

| Event | Controls |
| --- | --- |
| **Build Damage Info** | The damage before it is sent, for crit scaling or an elemental pass. It receives the socket that struck, so damage can vary by contact point. |
| **Handle Damage Result** | Whether the hit is recorded. The default records everything except a result matching **Skip Record Tags**. An override replaces that rule outright, so call **Record Hit** for the hits you mean to keep. |
| **Classify Hit** | The Damageable, Inert or Scenery sorting. |
| **Classify Contact** | Whether a contact is a body to damage, a sensor to report, or something to drop. The default drops a target holding one of **Pass Through Tags**, reports a component carrying one of **Sense Component Tags**, drops a trigger volume, and damages everything else. Call **Is Pass Through Target** and **Is Trigger Contact** from an override to keep those parts of the rule. |
| **Should Detect Hits** | Which machine sweeps. **UCF Melee Trace** answers by **Hit Detection Authority**: by default the machine of the player controlling the character, and the server for a character no player controls, every enemy included. The base trace an enemy built straight on **Enemy Character Base** carries answers the authority. |

Three nodes support those overrides. **Can Hit Actor** answers whether the swing may still land on a target, **Record Hit** spends the swing on one, and **Get Targets Hit This Window** counts what it has already struck, which is what damage falloff across a cleave reads.

**Build Damage Info** hands the target the damage config the attack was authored on. Make a child of **UCF Damage Config** to carry whatever else an attack needs, poise damage or a stagger tier, and cast it in the target's **Handle Incoming Damage**.

</details>

<details>
<summary>An effect does not play (Advanced)</summary>

- **The hit is the wrong kind.** An effect runs on damageable hits by default. Tick **Run on Inert Hits** for a corpse or any character with Can be Damaged switched off, **Run on Scenery Hits** for a wall. A character a **UCF Invulnerable** response protects is damageable, so it needs neither.
- **A gate sits it out.** Check **Suppress on Result Tags**, **Require Any Result Tags**, **Require Any Target Tags**, **Suppress on Target Tags** and **Require Damage Applied** against what the target reported.
- **The side is unticked.** **Affected Sides** decides who an effect reaches; a cue effect plays its **Attacker Cues** only while Attacker is ticked, and its **Target Cues** only while Target is.
- **The surface variant does not play.** A variant plays only when the project has a gameplay tag by the finished name, such as `GameplayCue.UCF.Hit.Slash.Flesh` or `GameplayCue.UCF.Enemy.Hit.Flesh`. Without one the cue plays as authored.
- **The demo cues are gone.** They load while **Load Demo Hit Effects** is ticked under Project Settings, Plugins, Universal Combat Framework Demo, and the change applies after a restart.
- **A hit stop holds nothing.** The character needs a **UCF Anim Manager** with **Hit Stop Enabled**, the **UCF Hit Stop** node in its Animation Blueprint, and a **Max Hit Stop Seconds** above 0.

</details>

<details>
<summary>Fists, claws and anything without a weapon (Alternative)</summary>

An item covers bare hands too, on the player and on an enemy alike: an unarmed item's **Trace Sockets** rows leave **Source Component Tag** empty and name bones on the character's own mesh, such as `hand_r`, so its sockets come and go as it is drawn. The demo's `Item_UCF_Unarmed` is built that way, and every demo enemy holds it as the **Default Item** it falls back on.

A pawn with no weapon registers its own sockets from Blueprint, usually on Begin Play. Three nodes on the trace component cover it:

| Node | Registers |
| --- | --- |
| **Register Sphere Socket** | One point on a bone. Hands, feet, a horn. |
| **Register Capsule Socket** | One point with a widened swept path. |
| **Register Two-Point Capsule** | A span between two bones or sockets. |

Give each an **ID** and name it on the montage window exactly as a weapon's socket would be named. **Unregister Trace Socket** and **Unregister All Sockets** take them away again.

</details>

<details>
<summary>Driving damage yourself (Alternative)</summary>

**Damage Application** on the component picks what a landed hit does.

| Setting | Sends |
| --- | --- |
| **Damageable Interface** | Asks the target through **UCF Damageable**, and falls back to Unreal's point damage for a target without it. |
| **Point Damage** | Unreal's point damage, for a project that handles everything in Event Any Damage. |
| **None** | Nothing. The hit is still detected, recorded and broadcast. |

On **None**, bind **On Melee Hit** and do the whole thing yourself. The event carries the hit result, the socket that struck, the damage config the window opened with, and how the trace sorted the contact.

</details>

<details>
<summary>The same pipeline for a projectile or an explosion (Alternative)</summary>

**UCF Damage Statics** opens the melee path to any other source, so an arrow and a sword resolve the same way.

| Node | Does |
| --- | --- |
| **UCF Deal Damage** | Asks the target through **UCF Damageable**, falling back to point damage. |
| **UCF Deal Point Damage** | Skips the interface and sends Unreal's point damage. |
| **Classify Damage Target** | Sorts a hit into Damageable, Inert or Scenery, the way the sweep does. |
| **Run Hit Effects** | Runs a damage config's whole effect list once the outcome is known. |

The first two apply damage on the server and report an empty result anywhere else.

</details>

<details>
<summary>Opening a trace window without a montage notify (Alternative)</summary>

Three nodes on the trace component drive a window by hand, for an attack whose timing comes from somewhere other than a montage.

| Node | Does |
| --- | --- |
| **Start Tracing** | Opens a window on the socket IDs given, or on every registered socket when the list is empty. Takes the damage config for that window, and a debug draw override for it alone. |
| **Start Tracing Simple** | The same, taking a loose damage figure in place of a config. A figure below zero falls back to **Base Damage** on the component. With no config the window runs no hit effects and sends the component's **Damage Type Class**. |
| **Start Tracing with Tags**, **Start Tracing Simple with Tags** | The same two, with **Extra Damage Tags** describing this swing on top of what its damage config carries. |
| **Stop Tracing** | Closes the window and clears its hit records. |

**Get Registered Socket IDs** lists what is there to name, and **Is Tracing** answers whether a window is open.

</details>

<details>
<summary>Which machine finds a hit (Multiplayer)</summary>

An enemy's trace sweeps on the server alone, so its **On Melee Hit**, **On Melee Hit Response** and **On Melee Sensed** fire there. A cue effect fired on the server reaches every client through the ability system, so an enemy's impact feedback plays for everyone.

**Hit Detection Authority** on **UCF Melee Trace** picks which machine sweeps the player's swings. **Project Default** reads **Default Hit Detection Authority** in Project Settings, Plugins, Universal Combat Framework.

**Details panel: Universal Combat Framework** (project settings, in Project Settings > Plugins)

**Category: Combat > Multiplayer**

| Property | Value |
| --- | --- |
| Default Hit Detection Authority | Client Authoritative |

**Category: Combat > Hit Stop**

| Property | Value |
| --- | --- |
| Max Hit Stop Seconds | 0.30 |

**Category: Combat > Rewind**

| Property | Value |
| --- | --- |
| Rewind History Seconds | 1.0 |
| Rewind Memory Budget MB | 8.0 |

*Project-wide combat defaults, saved to DefaultGame.ini. Default Hit Detection Authority picks the machine that sweeps a player's swings: an enemy's swings sweep on the server whatever it says.*

| Setting | Sweeps |
| --- | --- |
| **Client Authoritative** | The default. The machine of the player controlling the character finds that player's hits, so a swing connects on screen the moment it touches; the server finds the hits of every character no player controls. |
| **Server Authoritative** | The server finds every hit, and refuses hits a player's machine reports. A player then sees contact a round trip late. |

Under Client Authoritative, a player's hit travels to the server through the confirmed hit ability, which runs **Hit Validators** there before any damage. **On Melee Hit** and **On Melee Sensed** fire on the machine that swept; **On Melee Hit Response** fires where the hit resolved.

A team id carried on a controller reads as no team on another player's machine, since a controller replicates only to its own player, so put the team on the pawn. A window started by hand reaches the server with no damage config of its own, so a reported hit from one lands there with the trace's **Default Damage Config**.

</details>

<details>
<summary>What a player's machine plays at contact (Multiplayer)</summary>

**UCF Play Gameplay Cues** plays its attacker cues on the attacking player's machine the moment the swing connects, so an impact feels immediate at any ping. That early copy carries no damage figure and no fatal flag, since the server has not answered yet; the target's cues fire from the server alone and carry the damage the server worked out. Untick **Allow Predicted** to play every cue from the server, for a game whose hit checks refuse often enough that a wrong guess would show.

**UCF Send Gameplay Event** runs on the server alone, so the attacking player sees a reaction one round trip later, through the reaction ability's client instance. Author that ability **Server Initiated**, or it does not reach the player's machine. A repeat-landing attack, whose outcome tag sits in the trace's **Skip Record Tags**, sends the event again on each frame of contact; put the reaction's own state tag in that ability's **Activation Blocked Tags** to answer only the first.

A struck body that drives its ragdoll on every machine takes **UCF Apply Physics Impulse** on each copy when it carries a component that receives pushes.

Unreal sends one character at most two gameplay cue calls per network update. A hit effect's cue past that, from a swing through a crowd or a block's clang beside its hit stop, waits for the next update, a frame or two later, and is given up only after a quarter of a second without room. Two cases skip the wait and can still lose a cue: one your own code plays inside its own `FScopedGameplayCueSendContext`, which is counted when that context sends, and one on an ability system that replicates through a replication proxy, whose count the wait does not read. For those, raise `net.MaxRPCPerNetUpdate` under `[ConsoleVariables]` in `Config/DefaultEngine.ini`.

</details>

<details>
<summary>Extending the trace (C++)</summary>

- `UUCFCombatTraceComponent` is **UCF Melee Trace**. `UUCFMeleeTraceComponent` is its base, **UCF Melee Trace (Base)**, which Enemy Character Base creates as `MeleeTraceComponent`; `AUCFEnemyCharacterBase` sets that component's class to `UUCFCombatTraceComponent` through Enemy Character Base's object initializer constructor.
- `DeliverHit` carries a swept hit onward: the base resolves it on the machine that swept it, and **UCF Melee Trace** raises `UCF.Event.MeleeHit` for the confirmed hit ability. `KeepsSweepingAfterEnd` lets a window sweep past its end while a hit stop holds its pose, which **UCF Melee Trace** answers and the base does not. `OpenWindow` and `CloseWindow` take the whole window.
- A hit check in C++ or Blueprint subclasses `UUCFHitValidator` and overrides **Validate Hit**.
- `UUCFRewindSubsystem` (**UCF Rewind**) answers any hit source, a hitscan weapon or a projectile included, against the recorded targets as they stood: `Sweep` (**Rewind Sweep**) and `GetClosestDistance` some seconds ago, and the static `GetViewDelay`, how many seconds ago a player saw a target: that player's round trip, plus the target's mesh smoothing for a hit on any part but its capsule. `RegisterActor` and `RegisterComponent` record an actor or a part without the component.
- `UUCFAbilitySystemReady::NotifyAbilitySystemReady(Avatar, AbilitySystem)` is the **Notify Ability System Ready** node.

</details>

<details>
<summary>Extending hit effects (C++)</summary>

- A hit effect subclasses `UUCFHitEffect`, in Blueprint or C++, and overrides **On Hit**. **Should Run** applies every gate first; **Get Permitted Sides** and **Get Side Actor** name the characters it may touch on this machine. Override **Can Play Ahead** for work that must stay on the server.
- `UUCFDamageStatics::RunHitEffectList` runs a list for one hit with an `FUCFHitEffectContext`, whose **Source Ability** is the ability whose swing struck.
- An ability other than an action graph node takes an Impact Slow by implementing `IUCFImpactSlowReceiver`.
- A component implementing `IUCFPhysicsImpulseReceiver` on the struck actor takes the push from **UCF Apply Physics Impulse** in place of the default.
- **To Damage Definition** on a damage config builds the damage a target receives from its fields.

</details>

Previous page: [Defense](https://rigbak.com/docs/universal-combat-framework/defense). Next page: [Telegraphs](https://rigbak.com/docs/universal-combat-framework/telegraphs)
