- Home /
How can a Property show one set of values while the Member variables show another?
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
Answer by Bunny83 · Nov 14, 2013 at 02:27 AM
First of all what you see after position is what the ToString method returns. It rounds the values to one digit after the decimal point, seperates them with commas and encloses it in brackets. It's just a string representation of the vector ment for displaying.
The actual values are the ones you see behind each component.
Floating point numbers can't represent every number infinitely precise. Also due to rounding errors and / or precision issues calculations could be off a little bit. How much depends on where your "floating point" is. In other words it depends on how big / small the number is.
times 10 to the power of -6 (or short 1.6E-6) is actually 0.0000016 which is almost 0
You have to live with those numbers. It's not a bug since this is the known and expected behaviour ;)
Thank you for the answer, Sorry did'nt mark it correct I didn't realise I had double posted the question
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Issues rotating around transform.up 2 Answers
Fixing screen resolution 1 Answer
Problems with pause menu displaying items and stopping player movement 2 Answers