Overview
Combat Damage Component
The Combat Damage Component is a ready-to-use GraphInstance implementation for dealing damage using a Graph Object.
It handles:
- Graph initialization
- Entity binding
- Physics-based target detection
- Damage execution
- Projectile driving
Basic Usage
- Add
CombatDamageComponentto a GameObject - Assign a Damage GraphObject
- Configure Dealer / Target or Physics Detection
- Trigger damage via code or Physics Detection
Optional References
- Dealer EntityComponent
- Target EntityComponent
Useful for static relationships such as:
- Player-held weapons
- Enemy-attached weapons
Physics Detection
Supported detection modes include:
- IsTrigger Collider
- Rigidbody
- Overlap Sphere
- Overlap Capsule
- Sphere Cast
- Raycast
Each mode exposes different parameters and validates required components automatically.
Gizmos
Detection ranges are visualized in the Scene View.
Hit Filtering
- Layer filters
- Tag filters
- Ignore same target within X seconds
Prevents unintended multiple hits across frames.
Projectile Mode
Supported projectile modes include:
- Script Drive
Move the projectile by script. - Physics Drive
Move the projectile by Unity Physics System.
Projectile Features:
- Auto-seeking target
- Speed curve
- Gravity (for both modes)
- Lifetime
- On hit prefab
- Auto launch
Extension
Developers may inherit from GraphInstance to create custom damage logic,
but CombatDamageComponent covers most common scenarios.