From b92655c56fc41a08033d727a0b50578ae3f39dd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Mart=C3=ADnez=20Palacio?= Date: Mon, 14 Oct 2024 14:03:07 +0200 Subject: [PATCH] Add missing command for AICharacter --- Scripts/hiro_ai.gd | 5 +++++ 1 file changed, 5 insertions(+) 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