- Home /
Physics2D, Box Collider physics inaccuracy?
I am currently working on a game project and I have ran into issues with Physics2D, I am trying to have items in my game, these 2D items have 2D rigidbodies attached to them and 2D box colliders attached to them.
The issue I am running into is to do with gaps what are appearing between two objects.
I tried to illustrate the issue below
Is there a way to solve this issue? I have found similar threads with this issue, however i have never found a true solution to the problem.
You will notice, the bottom cans collide ( almost perfectly ) with the floor, however they intersect collisions with each other incorrectly. I had to make the box collider sizes SMALLER than the actual objects because this happens :
It seems like scale has an effect on why this happens, but is there a way that I can fix this? I can see that scale has at least some impact because the shelf collides better, which is at a larger scale than the cans.
I don't think you can "fix" it per se. You just need to choose a scale where they're not noticeable.
thats kinda annoying though, 3D physics work fine at this scale, im pretty sure, I dont get why 2D does not.
Just out of curiosity, how big ARE those gaps, anyway? In Unity units.
Answer by kacyesp · Aug 31, 2014 at 06:01 PM
I answered a similar question yesterday and the solution I found was to use edge colliders instead of box colliders.
Your answer
![](https://koobas.hobune.stream/wayback/20220613161907im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Colliders in a wall jut out 0 Answers
Multiple Stacked Colliders only register for single object 0 Answers
Collider2D/RigidBody2D not working 1 Answer
Collision with renderer.enabled? 0 Answers
My 2 Objescts doesnt collide 1 Answer