- Home /
Gap between 2D physics rigid bodies?
Is there any way to get rid of these gaps? I use meshes to paint polygon colliders, so there is no sprite that I can scale up/down. It seems as if the physics engine is not exact.
See images below:
Answer by TruffelsAndOranges · Dec 10, 2014 at 10:25 PM
I solved it by making a script that scales everything by 10.
It also works if you put the game objects in a GameObject with scale 10, and then set scale to 1 on all your objects.
It is a problem with Physics2D and Box2D, so it is not solvable in any other way.
Answer by DezBoyle · Dec 01, 2014 at 01:50 AM
I've had this problem before and I think it is a value in edit>physics2D I remember there being a gap because it prevents clipping but try messing around with the values until there is no gap. Alternatively , you could make the collider smaller in scale for the rocks.
Did not find any gap setting in the physics2D settings.
The rocks are drawn with pixel perfect fill meshes, to increase draw performance and also for easy editing of the levels and assets inside the editor => making the collider smaller in scale for the rocks does NOT work.
The only fix so far is to scale up everything by a factor of 10-20.. which kinda sucks.