I’m getting a weird bug whilst accessing a Vector3’s x,y,z parameters where the inspector is showing one set of values whilst the member variables themselves are displaying an entirely different set of values.
Is this a known bug? or is this a designed behaviour.
Either way I need some advice as I have no idea on where to even start correcting this kind of problem as direct assignment seems to make little difference.
/storage/temp/17873-inconsistantparameters.png
but surely by 'Flooring' a value the binary bits would be exact, or am I missing the point?
– NanocenturyNot in floating numbers. In decimal numbers, sure. Floating numbers are stored internally using fractions and you can't get precise numbers with fractions. The link has more info. You will get whole numbers - which I see you did in your code, but the inspector wasn't on yPos. It was on the Vector3.
– DracoratLearn something new everyday, Thanks. So I should cast to something more precise before comparing?
– NanocenturyActually you should allow for small variances...
– Dracoratif(a - b < .001 && a - b > -.001) /*For all purposes, equal*/