When doing math with a vector2, it is not able to compare to a float constant. Is there some cast I am missing?
Vector2 v = new Vector2(.7f, .7f);
bool b1 = v.x == .7f; //True
Vector2 v2 = new Vector2(.6f + .1f, .7f);
bool b2 = v2.x == .7f; //False

When doing math with a vector2, it is not able to compare to a float constant. Is there some cast I am missing?
Vector2 v = new Vector2(.7f, .7f);
bool b1 = v.x == .7f; //True
Vector2 v2 = new Vector2(.6f + .1f, .7f);
bool b2 = v2.x == .7f; //False

Don’t test any floating point for equality. Here’s why, and how to work around it:
https://starmanta.gitbooks.io/unitytipsredux/content/floating-point.html