waypoint ai script not going all the way to waypoint

hello, everyone. I have this waypoint ai script, but it doesn't go all the way to the waypoints, it stops short I have no idea how to fix this. all help would be appreciated.

Here is my code:

@script RequireComponent(Rigidbody)
enum mt
{
    Sequence,
    Patrol
}
var waypoint : Transform[];
var speed : float = 20;
var movementType : mt;
private var currentWaypoint : int;
function Awake()
{
    if(movementType == mt.Patrol)
        transform.position = waypoint[0].position;
}
function Update()
{
    if(currentWaypoint < waypoint.length)
    {
        var target : Vector3 = waypoint[currentWaypoint].position;
        var moveDirection : Vector3 = target - transform.position;

        var velocity = rigidbody.velocity;
        if(moveDirection.magnitude < 1){
            currentWaypoint++;
        } else {
            velocity = moveDirection.normalized * speed;
        }

    } else {
        if(movementType == mt.Patrol)
            currentWaypoint = 0;
    }

    rigidbody.velocity = velocity;
}

Looks like you're changing to the next waypoint too early. If you're using the right scale, 1 means 1 meter so try to use a smaller number like 0.1 (10 centimeters).

if (moveDirection.magnitude < 0.1) {
    // waipoint reached
}