Fix Enemy logic

This commit is contained in:
2025-03-11 17:11:43 -07:00
parent 29af9062b5
commit 76b94f7be3
4 changed files with 315 additions and 326 deletions

View File

@@ -44,7 +44,7 @@ public partial class NavigationAgentClient : Node3D, INavigationAgentClient
if (!_canMove)
return;
var enemy = GetParent() as IEnemy;
var enemy = GetOwner() as IEnemy;
enemy.Move(safeVelocity);
}
@@ -71,7 +71,7 @@ public partial class NavigationAgentClient : Node3D, INavigationAgentClient
var rng = new RandomNumberGenerator();
rng.Randomize();
_patrolTimer.WaitTime = rng.RandfRange(5.0f, 10.0f);
var enemy = GetParent() as ICanPatrol;
var enemy = GetOwner() as ICanPatrol;
enemy.Patrol();
}
}