Hi all. I’m little confused with Untiy vectors math. Let’s say I performed few Vector rotations, finding intersections and so on to find vertices of rectangle. After these calculations performed I have two Vector2 with x value which practicially the same but slightly different: 42.0 (original value) and 41.9999962 (value affected by vector operations). How can I make my script to understand they are the same? I know that comparing with == resolves this problem for Vector2 and Vector3 types but what if I want to compare individual coordinates in the same way? Does Unity have something built-in for this problem or I should take care of this myself, for example with something like this:
bool isTheSame = Mathf.Abs(v1.x-v2.x) < 0.001;
Thanks in advance.