30.04.2017, 09:11
You shouldn't compare floating point values with the equality operator anyway. Floating point values are not exact due the way they work and rounding errors may occur. For example, 3.6 will be read back as 3.5999999046325684. This is fine for most purposes because you don't need this exact precision but when comparing them they are not the same.
You should try printing the individual values of the velocity and see what they actually contain.
You should try printing the individual values of the velocity and see what they actually contain.