Yeah, that’s a vague title. Struggling to explain what is happening.
Basically, my game is very simple right now, the character isn’t move vertically (only on X and Z; it’s a top-down game). Nowhere in the character’s 1 script is the Y position affected, and the character doesn’t have physics.
However, when I run the game, it works like it should; the character only moves sideways. However, in the Transform tab, the Y Position is changing, even though the character doesn’t move vertically at all.
The “Y position” seems to be related to the Z position, but not the X position. When I move the character in the Z-axis, the “Y position” changes, but the numbers aren’t the same.
Weirder still, once the “Y position” reaches 10, it goes back to 1. The opposite happens when it drops below 1 (it goes to 9.99…), it won’t display 0. And if it goes above 10, it increases at 1/10 the rate.
(Yeah, that’s literally all there is.)
It isn’t much of a problem as the game seems to work fine, it’s just a value in the editor spooking me, but anyone knows why this happens I’d appreciate their wisdom.
Please post a screen shot. There must be something else going on that you haven’t mentioned because you’re not even aware of it. So, please be sure to include the scene hierarchy, the scene tab, and the inspector.
Just recreated this. It seems to be a floating point precision error. If you click on the Y-value as this happens, you’ll see that it’ll be something like ‘5.117071e-08’. The ‘e-08’ indicates that It’s of the exponent -8, as in 0.00000001. So the -5.117071e-08 is actually -0.00000005117971. It’s close enough to zero that you shouldn’t need to worry about it. It’s an issue with computers in general, rather than unity.
Yep, it’s pretty important when you’re looking at the Inspector to make sure it’s wide enough that you see the whole value. Otherwise, it’s easy to get really confused about what you’re seeing!