private void OnTriggerEnter(Collider other) { if (!other.CompareTag("waypoint") || MatchComplete) { return; } var wp = WaypointGroup.Instance.GetTriggersWaypoint(other as BoxCollider); var wpIndex = WaypointGroup.Instance.GetWaypointIndex(wp); if (wp.isCheckpoint || wpIndex == 0) { _lastCheckpoint = wp; _nextCheckpoint = WaypointGroup.Instance.GetNextCheckpoint(wpIndex); } EnteredWaypoint(wpIndex, wp.isCheckpoint); }