protected void WalkOnPath() { if (currentPoint == null) { FindNearestPoint(); return; } float distanceToPoint = (transform.position - currentPoint.transform.position).magnitude; if (distanceToPoint <= REACH_DISTANCE) { Transform newPoint = patrolPath.GetNextPoint(currentPoint); SetNewPoint(newPoint); } }