Complex damage behaviors built from multiple capsule hit registrators, driven by UDamageBehavior assets and invoked via UANS_InvokeDamageBehavior.
Support: UE5.4 - UE5.6
- Damage Behaviors: Compose attacks from multiple capsules with filtering, per-source activation, payloads, and auto-damage handling.
- Anim Notify State:
UANS_InvokeDamageBehaviorto activate/deactivate behaviors over montage windows, with editor preview drawing. - Hit Registrators:
UCapsuleHitRegistratorcapsules supporting ByTrace and ByEntering detection modes, ignore lists, and debug visualization. - Sources System: Evaluate and target multiple sources (e.g.,
ThisActor,RightHand,LeftHand) viaUDamageBehaviorsSourceEvaluator. - Blueprint Events: Override behavior decisions in Blueprints (
ProcessHit,CanBeAddedToHittedActors, etc.) or bind to delegates. - Settings: Project settings for trace channel and default source evaluators; debug actors to preview capsules in editor.
# install as git submodule to your plugins folder
git submodule add https://github.com/Ciberusps/DamageBehaviorsSystem.git ./Plugins/DamageBehaviorsSystem
# to update plugin
git submodule update --remote
- Components
UDamageBehaviorsComponent- Behaviors
UDamageBehavior- Hit Registrators
UCapsuleHitRegistrator- Anim Notify State
UANS_InvokeDamageBehavior- Settings
UDamageBehaviorsSystemSettings- Blueprint Library
UDamageBehaviorsSystemBlueprintLibrary
Attach to an actor to host and control UDamageBehavior instances.
-
Properties
DamageBehaviors(Instanced): list of behaviors; each has aNameused to invoke.
-
Delegates
OnHitAnything(DamageBehavior, DamageBehaviorName, HitRegistratorHitResult, CapsuleHitRegistrator, Payload)
-
Key Functions
InvokeDamageBehavior(Name, bShouldActivate, DamageBehaviorsSourcesToUse, Payload)GetDamageBehavior(Name)GetDamageBehaviors()
Usage: Place capsules (UCapsuleHitRegistrator) on your actor or its equipment, configure sources (e.g., ThisActor, RightHand, LeftHand), and call InvokeDamageBehavior to start/stop windows.
Defines how hits are detected and processed while active.
-
Fields
Name: identifier used by notify/component.HitDetectionSettings:EDamageBehaviorHitDetectionType=ByTraceorByEntering, plus overlap options and collision profile for entering mode.bAutoHandleDamage: auto call into your damage pipeline (AI-friendly).bInvokeDamageBehaviorOnStart: utility for ability-driven flows.bAttachEnemiesToCapsuleWhileActive: optional attach behavior during active window.HitRegistrators to Activate: per-Source list of capsule names to enable.Comment: free text.
-
Blueprint Events
MakeActive(bShouldActivate, Payload)ProcessHit(HitRegistratorHitResult, CapsuleHitRegistrator, inout Payload_Out) -> boolCanBeAddedToHittedActors(HitRegistratorHitResult, CapsuleHitRegistrator) -> boolGetHitTarget(HitActor, HitRegistratorHitResult, CapsuleHitRegistrator) -> AActor*AddHittedActor(Actor, bCanBeAttached, bAddAttachedActorsToActorAlso)ClearHittedActors()
-
Delegates
OnHitRegistered(HitRegistratorHitResult, DamageBehavior, CapsuleHitRegistrator, Payload)
Behavior lifecycle: when activated, it enables configured capsules by Source; hits are filtered (deduped per target) and surfaced via delegate or ProcessHit.
Capsule component that registers hits for behaviors.
-
Key Functions
SetIsHitRegistrationEnabled(bEnabled, HitDetectionSettings)AddActorsToIgnoreList(Actors)
-
Delegate
OnHitRegistered(HitRegistratorHitResult, CapsuleHitRegistrator)
Hit modes:
ByTrace: traces along movement each tick.ByEntering: uses overlaps; supportsbCheckOverlappingActorsOnStartand a configurableCollisionProfileName(e.g.VolumeHitRegistrator).
Anim notify state to open/close behavior windows.
Name: behavior name to invoke.TargetSources: map of SourceName -> enabled; if empty, defaults toThisActor.Payload:FInstancedStructpassed into behavior for custom data.
Editor Preview: in Animation editors the notify can spawn configured DebugActors and draw capsules for fast authoring.
Project Settings -> DamageBehaviorsSystemSettings:
HitRegistratorsTraceChannel: channel to trace inByTracemode.DamageBehaviorsSourcesEvaluators: list ofUDamageBehaviorsSourceEvaluatorclasses to provide actors per source name.DebugActors: per-mesh list of debug actors for editor preview.Fallback Debug Mesh: debug actors used when no specific mesh entry exists.
GetTopmostAttachedActor(Actor) -> Actor*: utility used in target resolution.
- Add
UDamageBehaviorsComponentto your character/weapon blueprint. - Add
UDamageBehaviorentries inDamageBehaviorsand configure:- Name, HitDetectionSettings
- HitRegistrators to Activate per Source (names must match your capsule component names)
- Place
UCapsuleHitRegistratorcomponents on your actor/equipment and set their collision profile. - In your attack montage, add
UANS_InvokeDamageBehaviorspanning the hit window and setName+TargetSources. - Optionally handle
OnHitAnythingon the component orOnHitRegisteredon the behavior to apply damage/effects.
Tips:
- If no
TargetSourcesare specified, the system usesThisActor. - Use payload to pass per-attack parameters (e.g., damage scalars, tags).
- Enable capsules visualization via project settings
DebugActorsandFallback Debug Mesh. UCapsuleHitRegistratorwill draw traces/overlaps when the debug cvar is enabled.- Common checks:
- Ensure capsule collision profile allows overlaps/hits for the chosen channel.
- Verify
HitRegistrators to Activatenames match actual component names. - Confirm
TargetSourcesare enabled for your notify instance.
- The plugin registers a runtime module
DamageBehaviorsSystemand an editor moduleDBSEditor. - Integrates well with GameplayAbilities for ability-driven attack windows.
TODO:
-
debug actors presets - for Sword + Shield, Axe + Shiled quick swap
-
debug actors presets that works by Animation name, e.g. for sword anim s Sword + Shield, for axe - Axe + shield
-
when we pause in ANS it should show CapsuleHitRegistrator shapes
-
split DamageBehaviorsSystemSettings, DebugActors should be in separate settings for EditorOnly
-
move Debug from ANS to DBSEditor module completly