Melee integration

Wire an existing melee combat system to SDF with USDFMeleeHitSenderComponent — swing windows, one hit per target per swing, and explicit delivery results.

USDFMeleeHitSenderComponent is an optional bridge between a melee contact your game already detected and an SDF destructible. It detects nothing itself.

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.

Setup

  1. Add SDF Melee Hit Sender to the Actor that swings — usually the character, sometimes the weapon Actor.
  2. Configure HitSettings.
  3. Call Begin SDF Melee Swing when the damage window opens.
  4. Call Send SDF Melee Hit for each contact your trace detects.
  5. Call End SDF Melee Swing when the window closes.

No timer and no tick are used. The swing window is explicit state.

Hit settings

FSDFMeleeHitSettings:

PropertyDefaultMeaning
Damage25.0Conventional damage written into the payload
DestructionPowerLightCapability gate of the swing
ImpulseStrength500.0Impulse magnitude written into the payload
DamageTypenoneOptional engine damage type
GameplayTagsemptyTags carried through to listeners
bRequireActiveSwingtrueDelivery is allowed only between Begin and End
bSuppressRepeatedActorsPerSwingtrueOne Actor receives at most one hit per swing

Different attacks need different values: set HitSettings from your attack data just before Begin SDF Melee Swing, or use several sender components.

The swing concept

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 Actor for this swing
End Swing     -> closes the window
Next swing    -> history is reset again

Begin SDF Melee Swing accepts an optional requested id 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.

Sending a contact

Send SDF Melee Hit takes:

ParameterNotes
TargetActorOptional when HitResult already contains an Actor
HitResultYour trace or overlap result; supplies impact point and normal
AttackDirectionPoints from the attacker toward the target
InstigatorControllerController credited with the hit
DamageCauserUsually the character or the weapon Actor
WeaponAny UObject; SDF does not interpret it
RandomSeed-1 to generate one

It returns FSDFMeleeDeliveryResult:

FieldMeaning
bDeliveredThe hit reached a destructible
bSuppressedAsDuplicateSame Actor, same swing
bRejectedBecauseSwingInactiveNo swing window was open
bTargetSupportsDestructionThe target implements the destructible contract
TargetThe Actor that was addressed
SentHitThe exact payload that was built
DestructionResultThe target’s own evaluation

Two separate answers

Delivery and destruction are different questions. bDelivered says the payload arrived; DestructionResult.Outcome says what the object decided to do with it. A Rejected outcome on a delivered hit means the object’s power gate refused the swing.

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:

AnimNotify: DamageWindowStart
    -> SDF Melee Hit Sender -> Begin SDF Melee Swing

Weapon trace produced a Hit Result
    -> SDF Melee Hit Sender -> Send SDF Melee Hit
         Target Actor        = Hit Result -> Hit Actor
         Hit Result          = Hit Result
         Attack Direction    = normalize(Target Location - Attacker Location)
         Instigator          = Get Controller
         Damage Causer       = self
         Weapon              = EquippedWeapon
         Random Seed         = -1
    -> break the returned result to log or react

AnimNotify: DamageWindowEnd
    -> SDF Melee Hit Sender -> End SDF Melee Swing

C++ example

// Damage window opens
MeleeSender->BeginMeleeSwing();

// For each detected contact
const FVector AttackDirection =
    (HitResult.GetActor()->GetActorLocation() - GetActorLocation()).GetSafeNormal();

const FSDFMeleeDeliveryResult Delivery = MeleeSender->SendMeleeHit(
    HitResult.GetActor(),
    HitResult,
    AttackDirection,
    GetController(),
    this,
    EquippedWeapon,
    /* RandomSeed */ -1);

if (Delivery.DestructionResult.bDestructionTriggered)
{
    // React: hit stop, camera shake, resource award...
}

// Damage window closes
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.

Common mistakes

SymptomCause
Nothing breaks, bRejectedBecauseSwingInactive is trueBegin SDF Melee Swing was never called, or End fired too early
One swing removes several times the expected damagebSuppressRepeatedActorsPerSwing was disabled
Debris flies toward the attackerAttackDirection is reversed
Delivered but Outcome is RejectedThe swing’s DestructionPower is below the profile’s MinimumDestructionPower

Last updated: 2026-08-13

Type to search titles, sections and keywords.