eNEMIES!!!!!!!!!
Enemys and enemy spawner - Press N to spawn wave - Press H to togglt hitboxs
This commit is contained in:
@@ -5,6 +5,9 @@ class_name HurtBox
|
||||
## Attach to any entity that can be damaged (players, enemies, destructibles)
|
||||
## NOTE: This is a passive detection zone - HitBox handles the collision detection
|
||||
|
||||
## Global debug visibility toggle (static-like via class name access)
|
||||
static var debug_visible: bool = true
|
||||
|
||||
## The entity that owns this hurtbox (should be a BaseUnit or similar)
|
||||
@export var owner_entity: Node = null
|
||||
## Debug mesh for visualization
|
||||
@@ -35,6 +38,10 @@ func _ready():
|
||||
_create_debug_visualization()
|
||||
|
||||
func _process(delta):
|
||||
# Update debug visibility
|
||||
if _debug_mesh:
|
||||
_debug_mesh.visible = HurtBox.debug_visible
|
||||
|
||||
# Handle hit flash timer
|
||||
if _hit_flash_timer > 0.0:
|
||||
_hit_flash_timer -= delta
|
||||
@@ -75,6 +82,7 @@ func _create_debug_visualization():
|
||||
if mesh:
|
||||
_debug_mesh.mesh = mesh
|
||||
_debug_mesh.material_override = _debug_material
|
||||
_debug_mesh.visible = HurtBox.debug_visible
|
||||
# Don't set transform - it inherits from parent CollisionShape3D
|
||||
child.add_child(_debug_mesh)
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user