Colliders doesn't work when they are too big?

Hi all,

I’ve come across a problem. When I create a box collider 2D whose length is around 1e+20, the collider doesn’t work. I think it’s due to the frustum culling or something. When a camera doesn’t see the center of the collider, the collider doesn’t work, I guess. When I change the size to make the collider smaller, the collider starts working.

How can I stop this? I don’t want collisions to stop when the camera can’t see the colliders.

Does it work when the collider is 1,000 units long? 10,000? Why would you need it to be 1e20??? That’s insanely huge.

1 Like

Unity is based on single-precision IEEE floating point numbers, and this includes the physics engine.

This means you have about 6 to 9 digits of accuracy and/or usable dynamic range, which is from 1e6 to 1e9 roughly.

https://en.wikipedia.org/wiki/Single-precision_floating-point_format

2 Likes

I’d be willing to bet that Unity’s QA team does not test the physics system with colliders in the hundreds of quintillions in length. Whatever issue you think that collider is solving, I’m sure there is an alternative approach you can try.

1 Like