A hitbox is an invisible geometric shape attached to a character, weapon or projectile that a game uses to decide whether contact has occurred. In game design, hitboxes translate what the player sees on screen into precise, testable rules for hits, damage and collisions, and their size, shape and timing strongly influence fairness, difficulty and game feel.
Players rarely see hitboxes, yet they notice them immediately when they feel wrong: a sword that visibly passes through an enemy without registering, or a bullet that hits despite a clear miss. Designing them well is therefore a core balancing task, not merely a technical detail of the physics engine.
How hitboxes detect contact
Each frame or simulation tick, the game runs an intersection test between active shapes. When an attacking shape overlaps a vulnerable shape, the game registers a hit and applies the consequences, such as damage, knockback or a sound cue. Visual models are far too detailed for this test, so designers use simple proxy volumes that are cheap to compute.
Strictly speaking, many designers separate two roles. The hitbox is the shape that deals an attack, while the hurtbox is the shape that can receive one. In casual usage, and in most shooters, the word hitbox covers both. A third category, the collision box or pushbox, keeps characters from walking through each other and usually does not cause damage.
The table below lists the most common shapes and why designers choose them.
| Shape | Typical use | Strength | Weakness |
|---|---|---|---|
| Axis-aligned box (AABB) | 2D fighters, platformers | Extremely fast test | Poor fit when rotated |
| Sphere or circle | Projectiles, explosions | Rotation-independent | Covers corners loosely |
| Capsule | Limbs, character bodies | Smooth fit for arms and legs | Slightly more costly |
| Oriented box (OBB) | Weapons, vehicles | Follows rotation tightly | More complex math |
| Mesh collider | Rare precision cases | Matches the model closely | Expensive and unstable |
Hitbox timing and frame data
Hitboxes are not static: they appear, move and disappear over time. In action and fighting games, an attack is divided into startup, active and recovery frames. The attacking hitbox exists only during the active frames, so its timing defines how fast and how punishable a move is.
At 60 frames per second, one frame lasts about 16.7 milliseconds, which is why competitive players discuss moves in single frames. Designers can also modify hurtboxes during an animation, for example shrinking them during a dodge to create invincibility frames, or extending them on a lunge so that overcommitted attacks can be punished.
This table shows how each phase of an attack shapes play.
| Phase | What exists | Design effect |
|---|---|---|
| Startup | Hurtbox only | Telegraphs the attack and sets reaction windows |
| Active | Hitbox and hurtbox | Defines reach and the hit window |
| Recovery | Hurtbox, often extended | Creates risk and punishment opportunities |
| Invincibility frames | Hurtbox removed or reduced | Rewards well-timed dodges |
Size, generosity and perceived fairness
Hitbox size is a deliberate balance decision. A common principle is asymmetric generosity: player attacks use slightly larger hitboxes than their visuals, while the player character uses a slightly smaller hurtbox. Many platformers and bullet-hell shooters shrink the player hurtbox to a small core, because near misses feel exciting while unfair hits feel frustrating.
In shooters, hitboxes are divided by body region so that designers can apply damage multipliers, most visibly for headshots. Body regions must be consistent across characters, or larger character models become easier targets, a recurring balance complaint in hero shooters where character silhouettes differ widely.
| Choice | Player perception | Typical genre |
|---|---|---|
| Enlarged attack hitbox | Attacks feel responsive and fair | Action adventure, brawlers |
| Reduced player hurtbox | Dodging feels skillful | Bullet hell, platformers |
| Exact visual match | Feels realistic but harsh | Tactical shooters, simulations |
| Region-based hitboxes | Precision is rewarded | Competitive shooters |
Hitboxes in networked games
Online play adds latency, so the target a player sees is slightly in the past. To keep aiming meaningful, many servers use lag compensation, also called rewinding: when a shot arrives, the server moves hitboxes back to where they were on the shooter’s screen and tests the hit there. This explains the familiar complaint of being hit after reaching cover.
Designers must choose between client-side hit detection, which feels responsive but is vulnerable to cheating, and server-authoritative detection, which is secure but can feel delayed. Most competitive titles use server authority with capped rewind windows, often limited to a few hundred milliseconds, to reduce abuse by high-latency connections.
Network rules also interact with tick rate. A server that updates 20 times per second samples positions every 50 milliseconds, while a 64-tick or 128-tick server samples far more often, so higher tick rates make hit registration more consistent at the cost of bandwidth and server processing.
Common hitbox problems and fixes
Most hitbox complaints trace back to a mismatch between visuals and logic. The following table pairs frequent symptoms with their causes and standard remedies used during playtesting and tuning.
| Symptom | Likely cause | Fix |
|---|---|---|
| Attacks pass through enemies | Tunneling at high speed | Swept tests or continuous collision detection |
| Hits register on empty space | Oversized or lagging hitbox | Shrink shape or sync with animation |
| Shot through cover | Lag compensation rewind | Cap rewind time, favor the victim |
| Uneven character difficulty | Inconsistent body regions | Standardize hurtbox volumes |
| Inconsistent results | Frame-rate-dependent checks | Run detection on a fixed tick |
Teams typically render hitboxes in a debug overlay during development, which makes these errors visible long before players report them.
The short version
A hitbox is an invisible outline that decides what counts as a hit. The game does not check the detailed picture of a character; it checks simple shapes, such as boxes or bubbles, placed around the body and the weapon.
Think of the shapes as the real playing field hidden under the artwork. When they match what you see, hits feel fair. When they do not, a game feels broken, even if everything else is polished. Good hitboxes make a game feel honest.
Where it makes a difference
A small team develops a 2D action game running at 60 frames per second. During playtesting, testers report that the boss’s tail sweep “hits from too far away.” The debug overlay shows the attack hitbox staying active for 12 frames and extending beyond the tail sprite by roughly a quarter of the character’s width.
The designer trims the hitbox to match the tail, reduces active frames to 6, and adds a 4-frame startup flash as a telegraph. The player hurtbox is also narrowed to the torso, excluding the flowing cape.
In the next test session, complaints about unfair hits disappear, average attempts to defeat the boss fall modestly, and testers describe the fight as challenging but readable, which was the original design goal.