void Update() { if (Vector3.Distance(transform.position, targetPoint.transform.position) <= targetPoint.GetRangeToExplose()) { enemy.Explode(); } agent.speed = enemy.speed; }