I reduced the scale of the gameobject from 1m to 1mm ie 0.001. Then, when i get the position(world) of the gameobject from the script, the script return a vector3 of (0.1,0.4,0.3). But i want to get the position in three decimal values(0.xxx,0.yyy,0.zzz).Can you suggest some methods to solve this problem
Just to make sure, does this happen if you use the model at 1.0 scale?
So, if you don’t scale it down, does the positions still retain it 3 decimals?
(This is debugging 101. If you do a change and another change doesn’t work, try reverting each change to find the culprit.)
Can you try using a model for your gameobject that is really 1mm in its 1.0 scale?
(This means, do you scale it down to 1/1000 because of the gameplay or just because you don’t want to or can’t have the model at the right side from the 3D software?)
Is the scaled down gameobject a child of another scaled down parent?
(Scaled down within another scaled down involve that the second scaled down has its transform multiplied by the parent scale’ values. So, if you got a parent at 0.5, all its children has its transform with 0.5x stuck to each of their value., then the position becomes (0.5)*Position which already drop the float precision value.)
This is just a supposition, but usually, it’s better to handle models at a 1.0 scale value as much as possible. Of course, static elements and temporary scale change such as if you got a kind of spell in a fantasy setting that shrink the enemy, you can scale down (while hoping it doesn’t break the rigs if there are animations) the model. It’s not a rule that should never be ignored, but more of a warning that, if you scale anything down, you’re asking for issues in the maths being handled by the engine.
Just in case, when you wrote “the script return a vector3 of (0.1,0.4,0.3)”, did you mean in a debug statement or that’s also what appears in the Transform panel when you select the gameobject? I know this is stupid, but just to make sure that it’s not just about the debug statement that drop the numbers while, internally, the numbers could be alright.