diff --git a/Assets/Scripts/Detection.cs b/Assets/Scripts/Detection.cs index c3acfcf..5c1339f 100644 --- a/Assets/Scripts/Detection.cs +++ b/Assets/Scripts/Detection.cs @@ -103,14 +103,19 @@ public class Detection : MonoBehaviour if(_projectileDamage == 0) { if ((other.gameObject.tag == "Opponent" && _entityLinked is Ally) || (other.gameObject.tag == "Ally" && _entityLinked is Opponent)) { _entityLinked.IsEnemyDetected = false; - enabled = false; - enabled = true; + StartCoroutine(ToggleCollider()); } } } } + IEnumerator ToggleCollider() + { + _collider.enabled = false; + yield return null; + _collider.enabled = true; + } //Getter and Setter public Entity EntityLinked