Quick Start
The shortest path to one working melee attack: a swung weapon that damages enemies once per swing. Everything here is required. Optional capabilities have their own How-To pages.
/CrimsonHitDetection/Examples/, but plugin content is hidden in the Content Browser until you tick Settings -> Show Plugin Content. Do that now.Steps 3 and 4 below build a preset and a profile from scratch, which is what teaches you the shape of them. If you would rather see one working first, duplicate
DA_CrimsonHitProfile_Melee and its TP_CrimsonMeleeSweep and skip to step 5.1. Enable the plugin
In Edit -> Plugins, enable CrimsonHitDetection and restart the editor. Epic's Gameplay Targeting System is a declared dependency, so it is enabled for you - there is nothing to tick separately.
2. Add sockets to the weapon
Open the weapon's skeletal or static mesh and add two sockets along the part that should hurt: one at the base of the blade and one at the tip. Name them anything; this page uses blade_base and blade_tip.
3. Create the Targeting Preset
This asset holds the geometry and the rules for who counts as a target. Right-click in the Content Browser and choose Crimson -> Hit Detection -> Targeting Preset.
Add tasks to Targeting Task Set in this order. Order matters: a selection task must come first, because filters can only remove candidates and there is nothing to remove from until something selects.
| # | Task | Set |
|---|---|---|
| 1 | Crimson Selection: Socket Sweep | One Socket Pairs entry: Start Socket blade_base, End Socket blade_tip, Radius 8 |
| 2 | Crimson Filter: Affiliation | Leave the defaults - hostile and neutral allowed, friendly and self excluded |
| 3 | Crimson Filter: Require Ability System | No settings. Stops scenery reaching your ability |
TP_CrimsonMeleeSweep (/CrimsonHitDetection/Examples/) is exactly this table. Open it to compare task order and settings, or duplicate it as your starting point.Its socket pair is set to
blade_base / blade_tip - the names used above. A shipped preset cannot know what your weapon's sockets are called, so this is the one field you must always change.4. Create the Hit Profile
Right-click in the Content Browser and choose Crimson -> Hit Detection -> Hit Profile. Set Targeting Preset to the asset from step 3. Leave Dedup Policy on Once Per Window - that is what makes one swing hit each enemy exactly once.
5. Add the component
Add a Crimson Hit Detection component to the attacking character. The owning actor must have Replicates enabled for its impact effects to reach clients.
On Hit Targets Resolved, On Hit Impact Cosmetic and On Hit Window State Changed in its Details panel.6. Tell the component which weapon is held
An animation notify has no way to know what a character is holding, so the component is told once, when the weapon is equipped.
On the character, after the weapon actor is spawned and attached: Get Component By Class (Crimson Hit Detection Component) -> Set Active Weapon Actor (Weapon Actor = your weapon actor reference). Do this on the server; the node is ignored elsewhere.
7. Author the active frames
Open the attack montage. On a notify track, add a Crimson Hit Window (Notify) state spanning the part of the animation where the weapon is actually dangerous. Set its Context Tag to something that names this attack - this page uses Attack.Melee.
The notify carries no Hit Profile. It authors timing and nothing else; the next step supplies the shape under this same tag.
Sweep Owner Mesh on the notify and skip step 6.Hit: Attack.Melee rather than a generic label - it shows the Context Tag, which is what has to match the ability. A bar reading Hit Window (no context tag) will never fire.8. Arm the profile and apply effects
In the ability that plays the montage, add a Crimson Hit Query node. Set its Profile to the asset from step 4 and its Context Tag to the same tag you put on the notify.
That node runs no query of its own. It arms the profile, the notify fires it, and every hit comes back out On Targets Hit. Nothing armed under the tag means the notify finds nothing and warns - so this step is required, not optional.
In the ability graph: Event ActivateAbility -> Play Montage And Wait, and alongside it (not chained after it) a Crimson Hit Query node with Profile = your Hit Profile and Context Tag = Attack.Melee.
From its On Targets Hit pin, break the Report struct and feed Target Data into Apply Gameplay Effect Spec To Target, using a spec from Make Outgoing Gameplay Effect Spec.
Call Cancel Query on the node if you need to stop detecting before the montage ends - a parry, or a combo handing off to the next attack.
Then run
Crimson.HitDetection.Debug 1 and swing again: you should see the swept capsule follow the blade in blue and a green marker with a normal arrow at each impact.Finally, set Play As Client with one client and a dedicated server. The handler must fire on the server only, while the client still receives
On Hit Impact Cosmetic.found no Hit Profile armed under Context Tag: the notify's tag and the Crimson Hit Query node's tag do not match, or the ability is not running while the montage plays. Matching is exact.Then turn on
Crimson.HitDetection.Debug 1 and read the shape.No capsule drawn at all: the sweep could not resolve a mesh. Check step 6 and the notify's
Sweep Owner Mesh setting.Capsule passes through the target but no impact marker: a filter rejected it. Run
showdebug TargetingSystem to see which task.Capsule nowhere near the blade: the socket names do not exist on that mesh. A missing socket falls back to the component's origin.