Jaconir
Game Dev LabStep 5 of 9

Auto Hitbox Generator

Author production 2D collision polygons from sprite alpha. Trace, drag vertices, validate, then export Godot, Unity, Matter.js, Box2D, SVG, or JSON — entirely in your browser.

Trace workspace

Load a sprite, tune the trace, drag vertices — author the collider before export

Sprite

demo_sprite.png

Trace settings

8

Higher ignores soft anti-aliased edges and glow.

1.5px

0 keeps every boundary pixel. 1.5–3 suits most sprites.

0px

Negative for a fair player hurtbox, positive for generous pickups.

Unity / Box2D units

Must match Unity Pixels Per Unit (and Box2D pixels-per-meter scale).

Drag vertices to author the collider

No collision polygon yet

Load a PNG with a transparent background, then adjust the alpha threshold until the silhouette is traced.

player_idle.png · 32×32 · RGBA

Vertices

From

Reduced

Coverage

Live output

Inspect, validate, and export production collision data

Nothing to author yet

Trace a polygon in the workspace — inspector, validation, and exports appear here.

Templates & examples

Collider presets tuned per role — applied instantly

Professional tips

Only what changes the collider you ship

Simplification

Raise tolerance until the overlay barely drifts from the art, then step back once. Most sprites land at 10–24 vertices with no gameplay difference — physics cost scales with vertex count, not visual fidelity.

Convex vs Concave

Use convex for projectiles, pickups, and anything numerous. Keep concave for terrain and large static props where the silhouette genuinely matters. Engines decompose concave shapes — it is never free.

Physics Optimisation

Ship one stable collider per actor role (hitbox vs hurtbox). Prefer ≤16 vertices for movers, keep pivots matched to your engine import, and clear validation (no self-intersections or tiny edges) before you paste into Godot or Unity.

Professional workflow

Where Auto Hitbox sits in a real 2D production pipeline

Comes in from

Bitmask Autotile Generator

Hands you a bitmask terrain sheet your tilemap can auto-place.

This step · Collision & Physics

Auto Hitbox Generator

Produces a traced collision polygon fitted to your sprite silhouette.

Goes out to

Polygon Collider Simplifier

Needs a traced collision polygon fitted to your sprite silhouette.

Frequently asked questions