HitBox3D - cluttered-code/godot-health-hitbox-hurtbox GitHub Wiki
inherits: Area3D
Detects HurtBox3D components to automatically apply damage or healing.
Description
Detects HurtBox3D components to automatically apply damage or healing. Can also detect collisions with other HitBox3D
components.
hurt_box_entered and hit_box_entered signals are provided to enable the User to create more complex interactions.
[!CAUTION]
ignore_collisions = true
should be set when callingqueue_free()
to avoid collisions with other components.
[!warning] The
Collison Mask
needs to be set so HurtBox3D and HitBox3D collisions can be detect.Collision Layer
is optional. It needs to be set to enable collision detection by HitScan3D and other HitBox3D components.
Tutorials
Properties
type | name | default |
---|---|---|
Health.Action | action | DAMAGE |
int | amount | 1 |
bool | ignore_collisions | false |
Signals
hit_box_entered
signal hit_box_entered(hit_box: HitBox2D)
Emitted when colliding with another HitBox2d
. Useful for interactions between projectiles and melee weapons.
- hit_box is the other
HitBox3D
being collided with.
hurt_box_entered
signal hurt_box_entered(hurt_box: HurtBox3D)
Emitted when colliding with a HurtBox3D. Will apply DAMAGE
or HEAL
to HurtBox3D after emitting.
- hurt_box is the HurtBox3D being collided with.
action_applied
signal action_applied(hurt_box: HurtBox3D)
Emitted after DAMAGE
or HEAL
is applied to HurtBox3D.
- hurt_box is the HurtBox2D the action was applied to.
unknown_area_entered
signal unknown_area_entered(area: Area2D)
Emitted when colliding with an Area2D
that isn't a HurtBox3D or another HitBox3D
.
- area is the
Area2D
being collided with.
Property Descriptions
action
@export var action: Health.Action = Health.Action.DAMAGE
The Health.Action to perfrom on the affected Health component.
amount
@export var amount: int = 1
The amount of the Health.Action to perfrom on the affected Health component.
ignore_collisions
@export var ignore_collisions: bool = false
The Health.Action to perfrom on the affected Health component.