I ran into a pretty common programming issue where single precision comparisons are unreliable. For those who don’t know, it’s pretty accepted that best way of comparing decimal number values (single precision) is to compare the difference between the two values and if it’s within a certain threshold, say 0.000001 (or the float type’s epsilon), then they can be ‘considered’ equal.

So rather then just doing “if(floatA == floatB)” you have to do “if(ABS(floatA – floatB) > epsilon)”  or specifically in Unity “Mathf.Approximately(floatA, floatB)”.

More…