How-To: Hit Zones
Goal: report which part of a target was struck, so head shots and weak points can be worth something. Optional - skip it if every hit on an actor is equal.
FGameplayTag on the impact. What a head shot is worth is your damage execution's decision, not this plugin's.1. Choose a mechanism
| Mechanism | Use when | Cost |
|---|---|---|
UCrimsonHitZonePhysicalMaterial | Your project authors physics assets. Preferred | One physical material asset per zone. No per-actor setup, and it survives skeleton renames |
UCrimsonHurtboxComponent | Authoring physical materials is impractical | One bone-to-zone map per skeleton, maintained by hand |
2a. Physical materials
Right-click in the Content Browser and choose Crimson -> Hit Detection -> Hit Zone Physical Material. Set its Zone Tag, then assign it to the relevant body in the skeletal mesh's Physics Asset. A physics asset already assigns a physical material per body, which is exactly per-zone granularity.
Crimson Selection: Socket Sweep, Crimson Selection: Actor Sweep and Crimson Selection: Trace request physical materials. The Targeting System's own AOE and Trace tasks do not, so a preset built on those falls back to the hurtbox component - and an AOE overlap reports no bone name either, so it resolves no zone at all. Crimson Selection: Area overlaps too, so the same limit applies to it.2b. Hurtbox component
Add a Crimson Hurtbox component to the target and fill in Bone Zones. Lookup walks up the skeleton, so mapping head also covers every bone parented under it - which matters because physics bodies routinely report a child bone such as a jaw rather than the one you mapped. Default Zone Tag covers everything unmapped.
Crimson.HitDetection.Debug 1 and strike the zone. An impact carrying a zone tag draws in amber rather than green, so you can see zone resolution working without reading a log.3. Read the zone
Break the Report from On Hit Targets Resolved, break an entry of its Impacts array, and read Zone Tag. To resolve a zone from a hit result you obtained elsewhere, use the Resolve Hit Zone Tag node.
Turning it off
Untick Resolve Hit Zones on a profile whose attacks never care about zones. It costs nothing when targets declare none, so this is a clarity setting rather than a performance one.
See also
- How-To: Area Attacks and Hitscan
- API Reference