Rigidbody will not rotate correctly

I can't get my spider-shaped rigidbody game object to rotate correctly. To test out the Rigidbody capabilities, I've given a capsule a basic movement function.

void Move(Vector3 position)
{
    previousPosition = transform.position;
    Vector3 direction = position - transform.position;
    direction.y = 0;
    if (direction.magnitude < 0.2F)
    {
        if (num == (waypoints.Length - 1)) num = 0;
        else num++;
        return;
    }

    // Rotate towards the target
    transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(direction), 1 * Time.deltaTime);

    rigidbody.AddRelativeForce(transform.forward, ForceMode.VelocityChange);
}

This capsule is supposed to follow a series of waypoints, but it's going in the wrong direction and off the expected path completely. To be more specific, the capsule turns is some odd direction, and then continues to move in that direction and never changes its direction. I really hope someone will want to help me. I know the physics in Unity can be quite complex, but it's also widely used - so hopefully there is someone who has had this problem before.

When you get to a path node, you are updating the index, but not the the position:

if (direction.magnitude < 0.2F)
  {
      if (num == (waypoints.Length - 1)) num = 0;
      else num++;
      position = waypoints[num]; // <-- change target position ADD ME
      // assuming  Vector3[] waypoints;
      return;
  }

But, the missing dest-update should cause it to swing in a big circle back to that first destination. You say it's not doing that, so something else must also be jinked. I'd try testing with the rotation "snapped" to the final: `transform.rotation = Quaternion.LookRotation(direction);`

If you want to move the object in the direction it's facing move it along it's local z-axis. I would comment out the speed modifier for now and keep the code as simple as possible till u get this part working right. seems like a bit of excess code in here that u may not need. If your spider is on a flat surface then Slerp should be ok, otherwise u might want to raycast for the normal that it's sitting on. I'm new to this too so I'm just throwing in anything that can help.