diff --git a/Assets/Scripts/Fighters/AntiPlayer.cs b/Assets/Scripts/Fighters/AntiPlayer.cs index 5c43430ad91e8243daf4193bb887d71306a5beb6..8a7fb9f7f1ee690d43d36a6c2e1d775047307966 100644 --- a/Assets/Scripts/Fighters/AntiPlayer.cs +++ b/Assets/Scripts/Fighters/AntiPlayer.cs @@ -36,7 +36,7 @@ public class AntiPlayer : Fighter, IFighterCallback protected override void Update() { base.Update(); - if (currentTargetEnemy == null) + if (!alive || currentTargetEnemy == null) { return; } diff --git a/Assets/Scripts/Fighters/Enemy.cs b/Assets/Scripts/Fighters/Enemy.cs index 79f775e9eefd4dc34a2f31f0ec520f2c23848b6f..88d15125f05e2a4d9f60962819c9a7e8f457ee96 100644 --- a/Assets/Scripts/Fighters/Enemy.cs +++ b/Assets/Scripts/Fighters/Enemy.cs @@ -20,10 +20,13 @@ public abstract class Enemy : Fighter protected override void Update() { base.Update(); - // Always face the AntiPlayer - var scale = transform.localScale; - scale.x = transform.position.x < antiPlayer.transform.position.x ? -initalScale.x : initalScale.x; - transform.localScale = scale; + if (alive) + { + // Always face the AntiPlayer + var scale = transform.localScale; + scale.x = transform.position.x < antiPlayer.transform.position.x ? -initalScale.x : initalScale.x; + transform.localScale = scale; + } } protected override bool CanAttack()