damage-health-framework

Implement modular damage and health systems for Unity game entities.

Updated Feb 25, 2026
One-click install
npx skills add https://github.com/Criezzz/Gametopia2026 --skill damage-health-framework
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: damage-health-framework
Source: https://github.com/Criezzz/Gametopia2026/tree/main/.agent/skills/damage-health-framework
Command: npx skills add https://github.com/Criezzz/Gametopia2026 --skill damage-health-framework

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Provides a consistent, reusable damage and health architecture to avoid duplicated health logic, inconsistent resistance calculations, and fragile death handling across players, enemies, and destructible objects.

Core Features & Use Cases

  • Interface-driven design: IDamageable interface and DamageInfo/DamageResult structs standardize how all entities receive and report damage.
  • Damage types & resistances: Built-in enums and DamageResistances allow Physical, Elemental, Poison, Holy/Dark, and True damage handling with configurable resistances.
  • Reusable components & events: HealthComponent and DamageDealer templates include healing, criticals, death, revive, and health-change events for UI/VFX integration and predictable gameplay behavior.
  • Use Case: Ideal for Unity projects implementing player/enemy health, elemental weaknesses, DOT effects, and reactive UI when health changes.

Quick Start

Add the HealthComponent to an enemy GameObject, set MaxHealth and resistances in the inspector, and call TakeDamage with a DamageInfo from your DamageDealer.

Frequently Asked Questions about damage-health-framework

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a modular damage and health system for Unity game entities?

A modular damage and health system uses an IDamageable interface and HealthComponent to standardize damage application for players, NPCs, and destructibles. It handles damage types, resistances, critical hits, healing, and death events predictably across your Unity project.

How do damage types and resistances work in a Unity health component?

Damage types and resistances use built-in enums and DamageResistances to process Physical, Elemental, Poison, Holy/Dark, and True damage. The HealthComponent calculates configurable resistance values when evaluating incoming DamageInfo to determine final health reduction.

Can I trigger UI and VFX updates when an entity's health changes in Unity?

Yes, you can trigger UI and VFX updates using built-in event hooks. The HealthComponent exposes death, revive, and health-change events, allowing your gameplay logic to subscribe and execute reactive visual feedback whenever damage or healing occurs.

What is the best way to apply damage to enemies from a weapon in Unity?

The best way to apply weapon damage is using a DamageDealer template. You construct a DamageInfo struct containing damage type and values, then pass it to the target's IDamageable interface, ensuring standardized damage calculation and resistance application.

Does this Unity damage system support destructible objects and environmental hazards?

Yes, the system explicitly supports destructible objects alongside players and NPCs. By attaching the HealthComponent and configuring resistances, any game entity can consistently process incoming damage, evaluate weaknesses, and trigger death events.

Why use an interface-driven architecture for handling death and revive logic?

An interface-driven architecture uses IDamageable and DamageResult structs to standardize death and revive reporting. This prevents fragile death handling and duplicated health logic, ensuring all entities interact with damage events consistently.