comparing vectors

whats the most accurate way of comparing two vector3’ taking floating point accuracy into account?

EDIT: I seem to get inconsistant results even though the data on screen is show the vectors are equal!

Yeah that’s float imprecision.

Instead find the distance between the two vectors.

Haha forget about something as simple as that, haven’t coded in a while and the simple things are just coming back to me.

If the exact distance it not required, it is more efficient to calculate the square of the distance:

   if( (v1 - v2).sqrMagnitude < 0.1 ) {
        // vectors are close
   }