- Home /
Is there an end to Unity world space?
If I arbitrarily set an GameObject's transform to Vector3(x,y,z) are there any limits to x,y,z ?
Answer by CHPedersen · May 09, 2011 at 08:10 AM
There is no mathematical limit per se, but x y and z are floating point numbers, so they are technically limited by the highest and lowest numbers that are representable with 32 bit floating points.
The "bounding box" of the Unity space should therefore consist of a cube with corners at (float.MinValue, float.MinValue, float.MinValue) and (float.MaxValue,float.MaxValue,float.MaxValue).
The max and min are plus/minus 3.402823E+38.
Well, that's the max value but you can't operate at these limits. The next lower value that is representable is 1.01412e+31 below the max value. Like Seth explained it's getting "really" inaccurate. Just to explain this number: you can't subtract 1 or 1000 or 1000000 from the maximum you have to subtract at least 1.014e+31, that's the "smallest" step. A number with 31 digits doesn't even have a SI prefix. They stop at 24(yotta). But technically you're right ;)
why is that happening ? why the precision near the center of the world is higher ?
Answer by Joshua · May 09, 2011 at 07:51 AM
I'm not sure, but more relevant is that there is a limit to where the scene views camera can go. So you won't be able to edit/see objects that are to far away.
That's not a big problem ;) You can move the camera closer. Sure, in game you also have your far clipping plane of your camera but that's not the point. Things can be outside of your viewing frustum but they are only visible if you move your camera closer so they enter the frustum.
No you can't move the scene camera closer, not even 'focusing' on an object out of those bounds (using f). And there also seem to be issues when you make the far clipping plane to large, after a point it suddenly slowed my fps from 100+ down to 5. I had these problems trying to make a sym of the solar system to scale :p http://www.kongregate.com/games/Josh_Amsterdam/space-exploration
Answer by Kacer · May 09, 2011 at 07:57 AM
If it works like any other 3D programme, then there isnt a hard limit on how far you can get away from the world 0 point. But, your posistion becomes more and more inaccurate the further you come away, making movement jittery and unprecise.