Unity Health & Combat Scripts
4 free C# scripts 2 beginner2 intermediate Unity 2022.3+, 6000.0+ MIT licensed
Combat in Unity usually comes down to two questions: what can take damage, and what deals it. The Health System answers the first. It is one component with damage, healing, invincibility frames and UnityEvents for every change, so health bars, popups and death effects can listen instead of polling.
The other scripts deal the damage. The Projectile System moves, collides and can home in on a target, and the Weapon System defines melee and ranged weapons as ScriptableObject assets with cooldowns and ammo. Weapon System Pro adds combo chains, weapon switching and damage types.
Start with Health System
Reusable health component with damage, healing, invincibility frames, and events.
HealthSystem.cs · 7 Inspector fields · beginner
Open Health SystemAll 4 health & combat scripts
- Health System Reusable health component with damage, healing, invincibility frames, and events.
- Projectile System Configurable projectile with speed, damage, lifetime, and optional homing. Integrates with Object Pool for zero-alloc shooting.
- Weapon System ScriptableObject-driven weapon system with melee and ranged attacks, cooldowns, ammo, and damage calculation.
- Weapon System ProPro Advanced ScriptableObject weapon system with combo chains, weapon switching, damage types, critical hits, and upgrade modifier slots.
What these scripts need
Read from each script's source, so this list stays in step with the code.
Reads the legacy Input Manager (UnityEngine.Input). If Project Settings > Player > Active Input Handling is set to Input System Package only, Unity throws an InvalidOperationException; set it to Both.
2 of 4: Weapon System, Weapon System Pro
Defines a ScriptableObject asset: create one from Assets > Create > Weapons > Weapon Data.
Applies to: Weapon System
Defines a ScriptableObject asset: create one from Assets > Create > Weapons > Weapon Data Pro.
Applies to: Weapon System Pro
Kits that build on them
- 2D Platformer Starter Kit Complete 2D platformer foundation with movement, camera, advanced mechanics, health, collectibles, and transitions.
- FPS Foundation Kit First-person shooter foundation with movement, camera, weapons, projectiles, health, and screen shake.
- RPG Essentials Kit Core RPG systems: health, inventory, dialogue, quests, save/load, and damage numbers — everything for an RPG prototype.
- Enemy AI Kit Complete enemy AI pipeline: state machine, patrol, chase, health, and wave spawning with debug visualization.
Guides that use them
- Free Unity C# Scripts and Game Systems: 55 Copy-Paste Tools for Indie Games A catalog of 55 free Unity C# scripts and 13 game systems: movement, camera, health, save/load, UI, AI, mobile controls, inventory and dialogue.
- Unity 2D Platformer Tutorial: Free Scripts & Complete Setup Build a complete 2D platformer in Unity with free scripts for player movement, camera follow, collectibles, health, and polish effects. Step-by-step guide with code.
- How to Build an RPG Quest System in Unity Build a complete RPG quest system in Unity with ScriptableObject-driven objectives, branching conditions, and persistent progress tracking.