I don’t get why my Vector3.y and when I print the vector3 is not the same the y values are not the same. Here is a picture of the output:[10755-unity+problem.png|10755] underlined in blue is the vector3.y and in red the y value of the whole vetor3. Each row is the same vector I just underlined for clarity. In the code I never modify this vector in any way nor the y value. I just use it to check for things in if statements. It’s really messing me up that these values are not the same. I understand they are close but why is there a difference at all? How can I get it to give me 0.0 instead of 0.00000000000000009432…?
For a discussion on floating point precision check out this answer:
For understanding how to deal with the difference between the printed value and the actual value look at this answer: