Hey,

What is the world space limit for dimensions?

I have been trying to draw some lines using line renderers but it does not show if it bigger than some number.

Here’s the screenshot for the positions:

Gameobject Position:(0.0, 0.0, 0.0)

LineRenderer Center:(13746850.0, 0.0, 20733010.0)

LineRenderer Extents:(418.0, 0.0, 318.8)

But nothing shows up in the editor nor in the runtime.

What is the solution to this? Are there some artificial limitations on line renderer / unity 3d / gpus ?

Thanks.

There are no limits.

  1. A camera can only see so far. Adjust your camera’s far clipping plane to see more or less.

  2. Beyond a certain point, floating-point numbers become less and less precise (meaning you can no longer be sure where they are @_@). There’s never any need to go out that far; a few-kilometer-wide game world is plenty. If you’re using huge things like planets, it’s a good idea to adjust Unity’s scaling (including the physics settings!) from 1u=1meter to something that makes them nicer to play with. You adjust this purely in your code; there’s no setting for unit size (except in project settings > physics).

Positions in the world are always represented with Vector3. The components of Vector3 (x, y, z) are 32-bit floats. There is only so much range and precision that can be represented with 32 bits of information.

According to this the approximate range for a float is ±1.5 × 10^−45 to ±3.4 × 10^38

Which gives you quite a lot of space to work with, but the farther out you go from Zero the precision of the representation in the 32-bits goes down. I’m paraphrasing and trying to use language that isn’t overly technical.

Here’s what you should take away from this. You should use floats as close to zero as possible. Treat a value of 1f as 1 meter in world space. 1000 kilometers of distance is only 1,000,000f, well within any tolerable range of precision, and well within anything you’d ever want to render. (If you want to render distant planets or something like that you change the scale, don’t try to render them thousands of kilometers away.

Forgive me if I’m wrong, but I believe the world space does not have a limit.