Hitbox

On this page 7

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.

ShapeTypical useStrengthWeakness
Axis-aligned box (AABB)2D fighters, platformersExtremely fast testPoor fit when rotated
Sphere or circleProjectiles, explosionsRotation-independentCovers corners loosely
CapsuleLimbs, character bodiesSmooth fit for arms and legsSlightly more costly
Oriented box (OBB)Weapons, vehiclesFollows rotation tightlyMore complex math
Mesh colliderRare precision casesMatches the model closelyExpensive and unstable
Common hitbox shapes

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.

PhaseWhat existsDesign effect
StartupHurtbox onlyTelegraphs the attack and sets reaction windows
ActiveHitbox and hurtboxDefines reach and the hit window
RecoveryHurtbox, often extendedCreates risk and punishment opportunities
Invincibility framesHurtbox removed or reducedRewards well-timed dodges
Attack phases and their design role

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.

ChoicePlayer perceptionTypical genre
Enlarged attack hitboxAttacks feel responsive and fairAction adventure, brawlers
Reduced player hurtboxDodging feels skillfulBullet hell, platformers
Exact visual matchFeels realistic but harshTactical shooters, simulations
Region-based hitboxesPrecision is rewardedCompetitive shooters
Hitbox size choices and their effects

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.

SymptomLikely causeFix
Attacks pass through enemiesTunneling at high speedSwept tests or continuous collision detection
Hits register on empty spaceOversized or lagging hitboxShrink shape or sync with animation
Shot through coverLag compensation rewindCap rewind time, favor the victim
Uneven character difficultyInconsistent body regionsStandardize hurtbox volumes
Inconsistent resultsFrame-rate-dependent checksRun detection on a fixed tick
Hitbox symptoms, causes and fixes

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.