Calculate a wanted velocity/direction?

Say I have a GameObject with a ridgidbody that is motionless. Given a direction and a force I use addforce() to accelerate the object in that direction. When the GameObject reaches a max velocity the force is no longer applied and the GameObject drifts along its path.

Now say I want to change direction, currently I’m using the ridgidbody’s drag setting to counteract the inertia. This works fine, but the problem is how do I determine when the GameObject is traveling in the new direction. I want the drag to be 0 when the GameObject is traveling in the correct direction so that I don’t have to apply force to keep the object up to speed and the drag to only be applied while the GameObject is changing direction.

Hope i made that clear enough to understand, Thanks.

Update:

This is called in FixedUpdate()

wantedDirection is a raycast direction from the mouse when no object or destination vector is given.

			direction = Vector3.MoveTowards(direction, wantedDirection, turnSpeed * Time.deltaTime);
			targetRotation = Quaternion.LookRotation(direction);
			transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, turnSpeed * Time.deltaTime);

			if (Vector3.Angle(direction, rigidbody.velocity) < 0.01f) 
				rigidbody.drag = 1.0f;
			else
				rigidbody.drag = 0.0f;
			
			if(currentSpeed < currentTopSpeed ){
				rigidbody.AddForce(direction * acceleration, ForceMode.Acceleration);
			}

You can use either Vector3.Angle() or Vector3.Dot() to determine if the ship is going in the same direction as the force is being applied.

if (Vector3.Angle(forceDirection, rigidbody.veloicty) > 0.01f) 
    rigidbody.drag = 2.0f;
else
    rigibody.drag = 0.0f;