Body and Hit Boxes

Body boxes say where a character can be hit. Hit boxes say where an attack does hit. Both are edited in two places at once: drag them in the preview for shape, type exact numbers in the Inspector.

If you cannot see any boxes, turn on Logic in the preview toolbar — it hides all overlays.

The Global Body Box Comes First

Character logic has one global body box, in Logic Settings. It is used by every frame that does not define its own body box.

Start here, and usually stop here. The original Streets of Rage 2 uses only this box for its characters. A single stable, predictable body box is normally better than one that changes shape frame by frame — players learn one hurtbox instead of guessing at each pose, and you have one thing to tune rather than dozens.

Add frame-specific body boxes only where the character's body is genuinely, visibly different: a low crouch, a long ducking slide, a boss that curls up. If you find yourself adding one to most frames, the global box is probably wrong and you are compensating for it.

Box Coordinates

Both box types use the same convention in the Inspector, and it is not the one you might expect:

  • X is the left edge, in pixels relative to the character's origin.
  • Y is the bottom edge.
  • Width grows to the right — the left edge stays put.
  • Height grows upward.

So changing Width does not re-centre the box. If you want to widen a box symmetrically, reduce X by half the amount you add to Width.

Body boxes additionally have Depth: how far the box extends along the towards/away axis. Depth controls how far apart two characters can be on the depth axis and still collide, which in a belt-scroller decides whether attacks that "look" aligned actually connect. Keep depth consistent across a character, and consistent with other characters they will fight.

The saved JSON stores body boxes as a centre with a half-width, but the editor shows and edits them as plain rectangles. You only need to care about this if you hand-edit logic.json.

Timing Within a Frame

A hit box or body box is not simply "on" for the whole sprite frame. Each has:

  • Relative Frame — the game frame, counted from the start of the selected sprite frame, on which the box becomes active. 0 is the first frame.
  • Duration — how many game frames it stays active.

This is what lets a single long sprite frame have a brief active hit window rather than being dangerous for its entire duration. It is also the usual fix when an attack feels like it hits too early, too late, or for too long: adjust the timing, not the sprite.

Hit Box Properties

Beyond the rectangle and its timing, each hit box carries the properties of the hit itself:

Property Effect
Damage Damage dealt to an opponent caught by the box.
Hit Pause Game frames both characters freeze on a successful hit. This is the main dial for how heavy a hit feels.
Knockdown Knocks the opponent down instead of just staggering them.
Hit Backwards Knocks the opponent away from the direction this character faces, rather than towards it.
Sound ID / Mod / Channel An impact sound specific to this hit box, overriding the character's default attack sound.
Classic Hitbox Uses the original SOR2 hit detection instead of the editor's own box.

A frame can hold several hit boxes with different timings — that is how you build a multi-hit attack inside one animation.

Editing in the Preview

The cursor tells you what you are about to grab:

  • Move cursor over the box body — dragging moves the whole box.
  • Horizontal or vertical resize cursor over an edge — dragging resizes that one side.
  • Diagonal resize cursor over a corner — dragging resizes both directions.

Drag for the rough shape, then type exact values in the Inspector. Boxes snap to whole pixels.

Order of Work

Pivots first, boxes second. Boxes are positioned relative to the character's origin, so if you move a pivot after tuning boxes, the visible relationship between sprite and box shifts and you will be re-tuning. If a pivot does change late, revisit that frame's boxes. See Pivots and Offsets.

Testing

Boxes are the part of a character most likely to feel wrong in ways that are invisible in the editor. Test in gameplay, and specifically test:

  • Grabs, at the edge of grab range.
  • Jump attacks landing on a standing opponent.
  • Being thrown, and landing among other enemies.
  • Projectiles and weapon attacks.
  • Crowding — several enemies pressed against the character at once.

Use hot-reload while testing so you can adjust and re-check without restarting. See Test Mod.

Related pages: The Inspector, Pivots and Offsets, Player Logic, Enemy Logic, Item Logic.