Fix Enemy logic
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user