diff --git a/Assets/Scripts/Car/Car.cs b/Assets/Scripts/Car/Car.cs index 3076e12..2b7a8f9 100644 --- a/Assets/Scripts/Car/Car.cs +++ b/Assets/Scripts/Car/Car.cs @@ -88,6 +88,9 @@ if (roadIndex == route.roads.Count - 1) { return false; } + if (Vector3.Distance(position, car.position) > 5) { + return false; + } Road conflict = car.road; float otherDistance = conflict.path.length - car.roadPositon; for (int i = car.roadIndex; !this.route.roads.Contains(conflict) && i < car.route.roads.Count;) {