Drop-in Hitbox2D and Hurtbox2D for Unity 2D: teams, knockback, i-frames, crits and damage resistances, with zero collision-layer setup.Runtime components are pure gameplay logic - no shaders or materials - so they work identically in Built-in, URP, HDRP and custom pipelines, using only Physics 2D. The optional demo scene uses legacy TextMesh, authored for Built-in, so its damage numbers may render incorrectly in URP/HDRP. Demo only - never the runtime you ship. The Samples folder can be deleted safely.Your hitbox turns on right on top of the enemy — and nothing happens.Every 2D dev hits this one. OnTriggerEnter2D only fires when a collider enters. If your attack activates while it is already overlapping the target, the hit is silently lost. So you start patching: manual overlap calls, a layer matrix nobody remembers, and a list to stop the same enemy taking damage every physics frame.Saltmire Hitbox is that whole layer, already solved.Add Hitbox2D to your attack and Hurtbox2D to whatever can be hurt. Give them different teams — that is the entire setup, with no collision matrix to maintain. Call Activate() when the swing starts and it also catches targets that are already overlapping, so the hit never goes missing.HONEST ABOUT SCOPEThis is a focused runtime layer, not a full combat framework. There is no health bar, no enemy AI and no weapon inventory — on purpose. It does hit detection and damage delivery, does it correctly, and stays out of your way. Three clean, commented scripts you can read in one sitting, wired to whatever health and feedback systems your game already has.TESTED, NOT JUST WRITTENShips with 7 PlayMode tests covering every rule it claims: hits between different teams, same-team immunity, one hit per swing, critical multipliers, resistances, and hits correctly swallowed by invincibility frames. Open the Test Runner and verify the behaviour yourself before you trust it in your game.FEATURES- Team-based hits: allies never damage each other, no layer matrix to maintain- Already-overlapping detection: Activate() resolves targets the hitbox switches on top of, fixing the classic melee bug- One hit per swing (oneShot): a lingering hitbox will not drain a target every frame; ResetSwing() re-arms it- Invincibility frames: per-hurtbox i-frames with an OnInvincibilityEnded event- Knockback: impulse direction computed away from the hitbox centre- Critical hits: chance and multiplier, flagged in the damage payload- Damage types and resistances: 0 is immune, below 1 resistant, above 1 weak- Accurate hit events: OnHit fires only when damage was actually dealt, and reports the final amount after crits and resistances- Zero setup: components self-configure onto a shared physics layer- No allocations on the hit pathINCLUDED- Hitbox2D, Hurtbox2D and DamageInfo: fully commented C# source- Playable demo scene with floating damage numbers and critical hits- Custom inspectors with inline documentation and setup warnings- Offline documentation (RTF) with table of contents, setup guide and full script reference- 7 PlayMode testsREQUIREMENTS- Unity 2D with the built-in Physics 2D module- No third-party dependencies: no TextMeshPro, no packages to install- Works on every build target Unity supports, including WebGL and mobileDOCUMENTATION- Included in the package at Assets/SaltmireHitbox/Documentation.rtfThe C# source in this package was written with AI assistance (Claude), then reviewed, restructured and validated by the author. It is a port of the author's own Godot addon of the same name. All behaviour is covered by 7 PlayMode tests included in the package, which were run and pass against the shipped code. The demo scene, documentation and inspectors were authored the same way. No AI-generated art, audio or third-party content is included.

