From 3567c5553468003ef2b977e973484e9e0ca268d6 Mon Sep 17 00:00:00 2001 From: manhduyhoang90 Date: Thu, 4 Jun 2026 09:24:20 +0700 Subject: [PATCH] Update EnemyAI.cs --- Assets/Scripts/AI NPC/EnemyAI.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Assets/Scripts/AI NPC/EnemyAI.cs b/Assets/Scripts/AI NPC/EnemyAI.cs index 41210a9f..2906a2e3 100644 --- a/Assets/Scripts/AI NPC/EnemyAI.cs +++ b/Assets/Scripts/AI NPC/EnemyAI.cs @@ -26,10 +26,13 @@ public class EnemyAI : MonoBehaviour private void Start() { + player = GameObject.FindGameObjectWithTag("Player").transform; nextShootTime = Time.time + Random.Range(minShootDelay, maxShootDelay); InitBehaviorTree(); } + + private void Update() { behaviorTreeRoot?.Evaluate();