Collision Issue with small scaled objects

I’ve asked this question on the Answers side with no luck. I’m hoping one of you will have a suggestion.

I have a spaceship fps game that I’m having collision issues with. I’ve made the scale of everything small, so 1 meter looks ‘huge’, in doing so I believe that I’m running into collision issues with my laser (bullet) as it is 0.005 in size. The issue I’m having is that when the spherical collider radius is set at 0.005, it passes through objects 1m in size. When I increase the collider radius to .05, the laser hits the target before the rigidbody of the laser actually hits the target, though the physics work fine. How can I solve this problem?

side note: I’ve gone small so everything feels larger and more distant etc. I’ve decided to use the laser with a rigidbody instead of raycast (unlike bullets in other games) so the player will have to recover from being hit by an object with mass in space (ie, regain control of the ship).

Hope I havent left anything out. Any suggestions are welcome, and thank you again!

This is the wrong way to do it, if you need larger “scale” (so it feels distant) then put it further away. The physics engine does not work well if you have things that are incredibly small due to floating point errors. Only way to fix it is to scale things up, you can TRY lower the physics step timer, but I doubt it will help with this small of a scale.

Thanks Fholm, but isn’t the soft cap for distance at 10km until floating point erros begin to show?

Instead of being that small, perhaps I can change everything to reflect a 0.05 and up scale. Thanks again.

If you really need a big space, you could also try to divide your game into seperate scenes, which could refer to solar systems or galaxies, or whatever you like. Try to find a good balance between scale and the size of your scenes :wink:

Edit #1: 10km assuming that 1m = 1.0 unit.

Yes, it’s somewhere around there… I usually limit my worlds to a cube that is 1024x1024x1024 units, so 2048 across on all axes.

But I can easily build game worlds that are 100 times that size, without any floating point impression happening. The approach you took is the naive one where you just position everything in the world using one coordinate system, this does not really work (as you may have noticed) :slight_smile:

Edit #2:

Also, you will get floating point impression if you go to small also, which is exactly what is happening to you. As I said you can try to lower the physics time step, but I doubt it will help at this scale.

Agreed.