diff --git a/Scripts/hiro_ai.gd b/Scripts/hiro_ai.gd index ae86a2d..a6880a2 100644 --- a/Scripts/hiro_ai.gd +++ b/Scripts/hiro_ai.gd @@ -18,6 +18,8 @@ extends CharacterBase @onready var attack_hitbox_collider = $Attackbox/Collider @onready var hitbox_collider = $Attackbox/Collider @onready var state_machine: StateChart = $StateMachine +@onready var melee_hitbox = $Meleebox +@onready var melee_hitbox_collider = $Meleebox/DetectionArea var timer = 0 @@ -70,6 +72,9 @@ func set_ai_process_mode(mode: ProcessMode): func set_ai_enabled(enabled: bool): set_ai_process_mode(Node.PROCESS_MODE_INHERIT if enabled else Node.PROCESS_MODE_DISABLED) +func set_melee_box_enabled(enabled: bool): + melee_hitbox_collider.disabled = !enabled + func _on_ai_got_hurt(attack_power: int, attack_direction: Vector2): attacked_from = attack_direction received_damage = attack_power