Hitbox Component

The Hitbox component enables an object to receive damage and interact with the Health system. It works in tandem with the Health component to apply incoming DamageData such as from projectiles or explosions to a specific target.

🎯 Purpose

  • Detects damage through colliders
  • Multiplies incoming damage using a configurable scalar
  • Sends the result to a connected health or damage processing system

🧱 Setup Instructions

  1. Add the Hitbox script to any GameObject that contains a Collider.
  2. Set the Damage Multiplier to scale damage for this body part (e.g. headshot = 2.0).
  3. Hook up the On Hit UnityEvent to send damage to a Health or Hitpoint target.

Note

You can add multiple Hitbox components across a character’s body (e.g., head, torso, limbs), each with its own multiplier.

πŸ“ Inspector Overview

FieldDescription
Damage MultiplierScales the incoming damage (e.g., 1.0 = normal, 2.0 = double damage)
On Hit (DamageData)Event triggered when this hitbox is struck. Use it to forward the DamageData to your Health or custom damage handler.

βœ… Ideal For

  • Player and enemy limbs
  • Armor weak points
  • Vehicles with destructible modules

Tip

Pair this with a Health component on the root GameObject to fully enable health loss, VFX triggers, and death logic.