Melee integration
Wire your own weapon to SDF - with no code through the SDF Weapon Trace and the SDF Melee Window notify, or by hand with the SDF Melee Hit Sender - the blade sweep, swing windows, one hit per prop per swing, swing speed, weapon recoil and the delivery result.
Swing a sword at a pot and the pot breaks; swing past it and it stays whole; strike a prop that holds
the blow and, when you ask for it, the blade bounces back. USDFMeleeHitSenderComponent (SDF Melee Hit Sender) is the
optional bridge between a melee contact your game already detected and an SDF destructible. It detects
nothing itself: no trace, no timer, no tick.
Who owns what
Your game owns weapon traces, overlaps, animation notifies and what counts as a swing. SDF owns turning an accepted contact into a destruction payload, suppressing duplicates and reporting what happened. The integration kit added in 2.0.1 can own the trace for you.
The quickest way: SDF Weapon Trace
New in 2.0.1, the integration kit wires a weapon in with no code:
- Add SDF Weapon Trace (
USDFWeaponTraceComponent) to the weapon’s actor, or to the character whose mesh holds the weapon. - Put BladeBase at the guard and BladeTip at the point of the weapon mesh, or let the trace run the blade along the mesh’s longest axis.
- Give the weapon its strength with an SDF Melee Hit Sender on the same actor (one is added with the defaults when there is none).
- Place the SDF Melee Window notify state on each attack montage, over the striking frames.
While a window is open, the trace sweeps the blade every frame and sends every part of every prop it touches through that sender. The full walkthrough, with rolls and arrows, is Your own character.
Your own weapon, step by step
The steps below are what the kit does, for a weapon you trace yourself. The demo sword is a reference,
not a requirement. The demo character, ASDFDemoCharacter
(Source/SoulsDestructionDemo/Private/Demo/SDFDemoCharacter.cpp), does them in C++; a Blueprint
character can do the same.
- Add an SDF Melee Hit Sender to the character. Set its Hit Settings: Damage, Destruction Power, Impulse Strength and optional Gameplay Tags. The component’s defaults are 25, Light, 500; the demo sword uses 20, Medium, 750.
- When the attack starts, call Begin SDF Melee Swing. Leave Swing Speed at 0 (see Swing speed).
- During the striking frames only, sweep the blade each frame from where it was to where it is (see The blade sweep).
- For each hit a sweep returns - every component, not only the first of each actor: a stained-glass window’s panes sit inside its stone frame - call Send SDF Melee Hit with the hit result, the swing direction, the character’s controller and the character as Damage Causer. The sender delivers one hit per prop per swing; outside a swing it refuses the hit (Require Active Swing, on).
- When the window ends, call End SDF Melee Swing.
- Bind On Melee Recoil to play your rebound when a prop holds the blow (see Weapon recoil). On Melee Hit Delivered reports every delivery with its result.
SDF Body Hit and the SDF Body Window notify do it for a character’s roll or charge. A roll, a charge or a thrown object of your own uses the SDF Collision Hit Sender the same way: see Roll and collision integration. Arrows: see Projectile integration.
The blade sweep
The sender traces nothing: sockets on the weapon do nothing by themselves, unless an SDF Weapon Trace reads them. The demo character’s own sweep, which you can copy:
| What | The demo’s choice |
|---|---|
| Sockets on the weapon mesh | BladeBase at the guard, BladeTip at the point |
| When it sweeps | The striking frames, read from the attack’s own position: Attack Window Start (0.13 s) to Attack Window End (0.32 s) |
| What it sweeps | Spheres of 6 cm radius along the blade, each from that point of last frame’s blade to the same point of this frame’s |
| How often | 60 times a second |
| Against | WorldStatic, WorldDynamic, PhysicsBody and Destructible, by object type |
| Behind the character | Points of the blade behind the character are skipped |
Sweep by object type, not by trace channel: an animated prop’s Weapon Hit Assist answers object queries only (see Animated break), and a prop with Use Mesh Collision When Intact keeps its hit assist for object queries while every channel ignores it.
Because the window follows the playing attack’s position rather than a timer, a slower or faster attack stays in sync, and the wind-up and the follow-through behind the back never hit. A pot beside or behind the character is never broken by a swing that does not pass through it.
The demo character adds a reach below the blade so that a high slash still breaks a low prop: Swing Reach Below Blade (150 cm), stopping Swing Floor Clearance (20 cm) above the character’s feet. Set the reach to 0 to hit only what the blade touches. Draw Attack Sweep on the character draws the traced path for two seconds after each swing. These are properties of the demo character, not of the sender.
Hit settings
FSDFMeleeHitSettings, the sender’s Hit Settings:
| Property | Default | Meaning |
|---|---|---|
Damage | 25.0 | Conventional damage written into the payload |
DestructionPower | Light | Capability gate of the swing |
ImpulseStrength | 500.0 | Impulse magnitude written into the payload |
DamageType | none | Optional engine damage type |
GameplayTags | empty | Tags carried with the hit. SDF.Source.Melee is always added |
bRequireActiveSwing | true | Delivery is allowed only between Begin and End |
bSuppressRepeatedActorsPerSwing | true | One prop receives at most one hit per swing. The count follows the destructible component the hit reached, so the panes of one stained-glass window stay breakable one by one in a single swing |
The demo sword’s Hit Settings are Damage 20, Destruction Power Medium, Impulse Strength 750: above
the Light a Normal prop needs. Different attacks need different values: set HitSettings from
your attack data just before Begin SDF Melee Swing, or use several sender components.
Gameplay Tags also carry an attack’s identity. With an Attack Damage Table on the prop, an
entry for a tag such as Attack.Sword.Heavy gives that attack its own damage and power against props,
the most specific tag winning; a hit that matches no entry keeps its Hit Settings. SDF.Source.Fire in
the tags sets a Flammable prop burning. See
Who may break a prop, and how hard and
Fire and burning props.
The swing window
Begin Swing -> opens the window, clears per-target history, returns a stable swing id
Submit Contact -> Send SDF Melee Hit, once per detected contact
-> at most one delivery per prop for this swing
End Swing -> closes the window
Next swing -> history is reset again
Begin SDF Melee Swing accepts an optional requested id and a swing speed, and returns the active swing id. Is Melee Swing Active and Get Active Swing Id expose the current state.
This matters because a multi-trace weapon typically reports the same crate three or four times in one animation. Without suppression, a crate with 100 health would take 75 damage instead of 25 from a single swing.
Swing speed and Minimum Impact Speed
The sender measures nothing itself. Swing Speed, the weapon’s closing speed in cm/s, is what the prop compares with its Minimum Impact Speed:
- Swing Speed 0, the default: the hit reports no speed, the speed gate is skipped, and Destruction Power alone is in charge.
- Swing Speed above 0: it must reach the prop’s Minimum Impact Speed (300 cm/s on the built-in Behaviors), or the hit returns Too Slow.
Pass the value your animation or weapon system already knows when you want slow contacts, such as a
blade resting against a pot, to be refused. ActiveSwingSpeed shows the speed declared for the active
swing.
Sending a contact
Send SDF Melee Hit takes:
| Parameter | Notes |
|---|---|
TargetActor | Optional when HitResult already contains an Actor |
HitResult | Your trace or overlap result; supplies impact point and normal |
AttackDirection | Points from the attacker toward the target |
InstigatorController | Controller credited with the hit |
DamageCauser | The character |
Weapon | Any UObject; SDF does not interpret it |
RandomSeed | -1 to generate one |
Pass the character’s controller and the character itself. Allowed Breakers judges whoever dealt the hit, its Instigator’s pawn or the Damage Causer when it is a pawn, and no piece is launched back toward the hit’s Damage Causer, or else its Instigator’s pawn.
It returns FSDFMeleeDeliveryResult:
| Field | Meaning |
|---|---|
bDelivered | The hit reached a destructible |
bSuppressedAsDuplicate | Same prop (the same destructible component), same swing |
bRejectedBecauseSwingInactive | No swing window was open |
bTargetSupportsDestruction | The target implements the destructible contract |
Target | The Actor that was addressed |
SentHit | The exact payload that was built |
DestructionResult | The target’s own evaluation |
bShouldRecoil | The prop held the blow and makes the weapon bounce back |
Two separate answers
Delivery and destruction are different questions. bDelivered says the payload arrived;
DestructionResult.Outcome says what the prop did with it, and DestructionResult.RejectionReason
says why it did not break: Power Too Low, Too Slow, Not Allowed Breaker and the others.
Describe SDF Result turns the result into one sentence. See
Diagnostics.
Weapon recoil
With Weapon Recoils When Held on, on the Behavior or as an exception on one setup or one placed copy, a melee blow the prop holds makes the weapon bounce back. Off by default; no prop in the demo map turns it on.
- A prop holds a blow when it is indestructible or locked. A prop that breaks, or only loses health, never sends the weapon back.
- The sender sets
bShouldRecoilin the delivery result and fires On Melee Recoil, at most once per swing: a blade that bounces off a wall and then touches a pillar in the same swing recoils once. - SDF plays nothing: your character plays its rebound. The demo character holds the swing for Recoil Freeze Seconds (0.08 s), runs it backward for Recoil Seconds (0.3 s), then blends out over Recoil Blend Out Seconds (0.35 s).
See The world reacting to a break.
Non-destructible targets
Hitting a wall, an enemy or anything that does not implement the destructible contract is safe: the
result reports bTargetSupportsDestruction = false and nothing else happens. You do not need to
filter your traces before calling.
Blueprint example
Inside your character Blueprint:
Attack starts
-> SDF Melee Hit Sender -> Begin SDF Melee Swing
Swing Speed = 0
Each striking frame, the blade sweep produced a Hit Result
-> SDF Melee Hit Sender -> Send SDF Melee Hit
Target Actor = Hit Result -> Hit Actor
Hit Result = Hit Result
Attack Direction = the swing direction
Instigator = Get Controller
Damage Causer = self
Weapon = EquippedWeapon
Random Seed = -1
-> break the returned result to log or react
Striking frames end
-> SDF Melee Hit Sender -> End SDF Melee Swing
On Melee Recoil (bound once)
-> play the rebound
The Integration Examples map’s Sword Hit station (BP_SDF_Example_SwordHit) does the same with a
line trace; copy it and set its Target to try it on your prop. See
Integration examples.
C++ example
// The attack starts. Swing speed 0: no speed gate.
MeleeSender->BeginMeleeSwing(/* RequestedSwingId */ -1, /* SwingSpeed */ 0.f);
// For each actor the blade sweep hits this frame
const FSDFMeleeDeliveryResult Delivery = MeleeSender->SendMeleeHit(
HitResult.GetActor(),
HitResult,
SwingDirection,
GetController(),
this,
EquippedWeapon,
/* RandomSeed */ -1);
if (Delivery.DestructionResult.bDestructionTriggered)
{
// React: hit stop, camera shake...
}
else if (Delivery.bShouldRecoil)
{
// The prop held the blow: play the rebound (also broadcast by OnMeleeRecoil)
}
// The striking frames end
MeleeSender->EndMeleeSwing();
Listening to deliveries
OnMeleeHitDelivered broadcasts the full FSDFMeleeDeliveryResult for every call, which is a
convenient single place to drive hit stop, controller rumble or combat log entries without wiring them
at every call site. OnMeleeRecoil broadcasts the same result when a prop holds the blow and the
weapon should bounce back.
In a networked game
The server decides every break. A hit sent on a client changes nothing and its result says Server Decides. Run the swing where the server sees it, or send the client’s hit to the server through your own server RPC, as for Unreal damage. There is no prediction: a client sees its hit break the prop about half its ping later. See Networked games.
The SDF Weapon Trace opens on the server and in single player only, never on a client: the attack montage must play on the server, its mesh refreshing its bones there. See Your own character.
Common mistakes
| Symptom | Cause |
|---|---|
Nothing breaks, bRejectedBecauseSwingInactive is true | Begin SDF Melee Swing was never called, or End fired too early |
| One swing removes several times the expected damage | bSuppressRepeatedActorsPerSwing was disabled |
Delivered, Outcome is Reacted, reason Power Too Low | The swing’s Destruction Power is below the prop’s Minimum Destruction Power |
Delivered, Outcome is Rejected, reason Too Slow | A Swing Speed above 0 is below the prop’s Minimum Impact Speed: pass 0, or the real speed |
| Props behind or beside the character break | The sweep is not limited to the striking frames, or does not skip points behind the character |
| Nothing breaks on a client | The server decides: the result says Server Decides |
Last updated: 2026-10-29