
Publisher
clutteredcode
Health, HitBoxes, HurtBoxes and HitScans
2D and 3D Components to manage health, damage, and healing
This plugin has been mirrored from the Godot Asset Library.
The plugin author is in no way affiliated with Gadget.
If you are the author of this plugin and would like this mirror removed, please contact support@gadgetgodot.com.
Godot Health, HitBoxes, HurtBoxes, and HitScans
[!CAUTION] A lot changed in v5.0.0. It is recommended to update to v4.4.0 before going to v5.0.0 to avoid issues with component name changes. We're working hard to update the documentation. The components in the documentation are all now prefixed with "Basic". We added more complex variants to allow for multiple damage types and modifiers. Thank for the support!
Documentation
Check out the Wiki for Documentation and tutorials!
Process and Data Flow
flowchart LR
HitBox
HitScan
HurtBox
Health
HitBox -- detect collision and send **amount** --> HurtBox
HitScan -- detect collision and send **amount** --> HurtBox
HurtBox -- send **amount** and **multiplier** --> Health
Health
Health component tracks an entity's health and emits signals for various health realted changes.

Hurtbox 
HurtBox2D and HurtBox3D components require a Collision Shape so it can be detected and is assigned a
Health component to apply damage and healing when hit.

Hitbox 
HitBox2D and HitBox3D components require a Collision Shape to detect collisions with a
HurtBox2D or
HurtBox3D to apply DAMAGE or HEAL.

HitScan 
HitScan2D and HitScan3D components extend RayCast2D and RayCast3D to detect collisions with a
HurtBox2D or
HurtBox3D to apply DAMAGE or HEAL.

Live Example Demonstration
itch.io - godot-health-hitbox-hurtbox-hitscan
Installation
Asset Library Installation
- Open the
AssetLibtab in the Godot Editor. - Search for
Health,HitBox, orHurtBoxin the search bar. - Click the download button next to the Health, HitBoxes, and HurtBoxes plugin.
- Once the installation is complete, go to
Project->Project Settings->Plugins. - Find the
Health, HitBoxes, and HurtBoxesplugin in the list and check the box to enable it.
Usage

- Add a
Healthnode to a Node that needs health (ie.CharacterBody2DorStaticBody3D) - Add a
HurtBox2Dnode with aCollisionShape2Dto the same Node. - Set the
HurtBox2Dcollision layer. HitBox2DorHitScan2D- Create a projectile or melee weapon with a
HitBox2Dand set the collision mask to the same layer as theHurtBox2Dcollision layer. This will automatically apply damage and healing. - Create a gun with a
HitScan2Dextending from the barrel and set the collision mask to the same layer as theHurtBox2Dcollision layer.fire()needs to be called on theHitScan2Dto apply damage and healing.
- Create a projectile or melee weapon with a
Issues
Submit issues to the Github Issues Page